diff --git a/script/check_trace.py b/script/check_trace.py index a4506a12f8..c10eb3c5d5 100644 --- a/script/check_trace.py +++ b/script/check_trace.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - #Copyright (c) 2015-present Advanced Micro Devices, Inc. All rights reserved. # #Permission is hereby granted, free of charge, to any person obtaining a copy @@ -200,10 +198,10 @@ def check_trace_status(tracename, verbose, check_trace_flag): events_order_r[tid] = events_order[tid] cnt = gen_events_info(trace,trace_level,no_events_cnt,events2ignore,events2chkcnt,events2chkord,verbose) if verbose: - print '\n' + rtrace + ':\n' - print cnt_r - print '\n' + trace + ':\n' - print cnt + print ('\n' + rtrace + ':\n') + print (cnt_r) + print ('\n' + trace + ':\n') + print (cnt) diff_strings(cnt_r, cnt, metric) if cnt_r == cnt: diff --git a/script/gen_ostream_ops.py b/script/gen_ostream_ops.py index fcc379a629..ae60be84e7 100755 --- a/script/gen_ostream_ops.py +++ b/script/gen_ostream_ops.py @@ -1,5 +1,3 @@ -#!/usr/bin/python - import os, sys, re import CppHeaderParser import argparse diff --git a/script/hsaap.py b/script/hsaap.py index f9458ee9d8..e1a3d71784 100755 --- a/script/hsaap.py +++ b/script/hsaap.py @@ -1,4 +1,3 @@ -#!/usr/bin/python from __future__ import print_function import os, sys, re diff --git a/script/kfdap.py b/script/kfdap.py index 378ea12620..8de1d19ea0 100755 --- a/script/kfdap.py +++ b/script/kfdap.py @@ -1,4 +1,3 @@ -#!/usr/bin/python from __future__ import print_function import os, sys, re @@ -80,7 +79,7 @@ class API_TableParser: if not os.path.isfile(header): self.fatal("file '" + header + "' not found") - self.inp = open(header, 'r') + self.inp = open(header, 'r', encoding='utf-8') self.beg_pattern = re.compile(name) self.end_pattern = re.compile('.*\)\s*;\s*$'); @@ -146,7 +145,7 @@ class API_DeclParser: if not os.path.isfile(header): self.fatal("file '" + header + "' not found") - self.inp = open(header, 'r') + self.inp = open(header, 'r', encoding='utf-8') self.end_pattern = re.compile('\)\s*;\s*$') self.data = data diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 689ed6377f..556ea16df6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,13 +5,13 @@ execute_process ( COMMAND sh -xc "mkdir -p ${GEN_INC_DIR}" ) execute_process ( COMMAND sh -xc "mkdir -p ${GEN_SRC_DIR}" ) execute_process ( COMMAND sh -xc "${CMAKE_C_COMPILER} -E ${HSA_RUNTIME_INC_PATH}/hsa.h > ${GEN_INC_DIR}/hsa_pp.h" ) execute_process ( COMMAND sh -xc "${CMAKE_C_COMPILER} -E ${HSA_RUNTIME_INC_PATH}/hsa_ext_amd.h > ${GEN_INC_DIR}/hsa_ext_amd_pp.h" ) -execute_process ( COMMAND sh -xc "${ROOT_DIR}/script/gen_ostream_ops.py -in ${GEN_INC_DIR}/hsa_pp.h,${GEN_INC_DIR}/hsa_ext_amd_pp.h -out ${GEN_INC_DIR}/hsa_ostream_ops.h" ) -execute_process ( COMMAND sh -xc "${ROOT_DIR}/script/hsaap.py ${PROJECT_BINARY_DIR} ${HSA_RUNTIME_INC_PATH}" ) -execute_process ( COMMAND sh -xc "${ROOT_DIR}/script/kfdap.py ${PROJECT_BINARY_DIR} ${HSA_KMT_INC_PATH}" ) +execute_process ( COMMAND sh -xc "python3 ${ROOT_DIR}/script/gen_ostream_ops.py -in ${GEN_INC_DIR}/hsa_pp.h,${GEN_INC_DIR}/hsa_ext_amd_pp.h -out ${GEN_INC_DIR}/hsa_ostream_ops.h" ) +execute_process ( COMMAND sh -xc "python3 ${ROOT_DIR}/script/hsaap.py ${PROJECT_BINARY_DIR} ${HSA_RUNTIME_INC_PATH}" ) +execute_process ( COMMAND sh -xc "python3 ${ROOT_DIR}/script/kfdap.py ${PROJECT_BINARY_DIR} ${HSA_KMT_INC_PATH}" ) execute_process ( COMMAND sh -xc "${CMAKE_C_COMPILER} -E ${HSA_KMT_INC_PATH}/hsakmttypes.h > ${GEN_INC_DIR}/hsakmttypes_pp.h" ) -execute_process ( COMMAND sh -xc "${ROOT_DIR}/script/gen_ostream_ops.py -in ${GEN_INC_DIR}/hsakmttypes_pp.h -out ${GEN_INC_DIR}/kfd_ostream_ops.h" ) +execute_process ( COMMAND sh -xc "python3 ${ROOT_DIR}/script/gen_ostream_ops.py -in ${GEN_INC_DIR}/hsakmttypes_pp.h -out ${GEN_INC_DIR}/kfd_ostream_ops.h" ) execute_process ( COMMAND sh -xc "${CMAKE_C_COMPILER} -E ${HIP_PATH}/include/hip/hip_runtime_api.h ${HIP_DEFINES} -I${HIP_PATH}/include -I${ROCM_ROOT_DIR}/hsa/include > ${GEN_INC_DIR}/hip_runtime_api_pp.h" ) -execute_process ( COMMAND sh -xc "${ROOT_DIR}/script/gen_ostream_ops.py -in ${GEN_INC_DIR}/hip_runtime_api_pp.h -out ${GEN_INC_DIR}/hip_ostream_ops.h" ) +execute_process ( COMMAND sh -xc "python3 ${ROOT_DIR}/script/gen_ostream_ops.py -in ${GEN_INC_DIR}/hip_runtime_api_pp.h -out ${GEN_INC_DIR}/hip_ostream_ops.h" ) execute_process ( COMMAND sh -xc "mkdir ${GEN_INC_DIR}/rocprofiler" ) execute_process ( COMMAND sh -xc "ln -s ${ROOT_DIR}/../rocprofiler/inc/rocprofiler.h ${GEN_INC_DIR}/rocprofiler/rocprofiler.h" ) execute_process ( COMMAND sh -xc "ln -s ${ROOT_DIR}/../rocprofiler/src/core/activity.h ${GEN_INC_DIR}/rocprofiler/activity.h" ) diff --git a/test/run.sh b/test/run.sh index 75a5a68053..e8d8909523 100755 --- a/test/run.sh +++ b/test/run.sh @@ -86,11 +86,11 @@ eval_test() { is_failed=0; else if [ $is_failed = 0 ] ; then - python ./test/check_trace.py -in $test_name -ck $check_trace_flag + python3 ./test/check_trace.py -in $test_name -ck $check_trace_flag is_failed=$? if [ $is_failed != 0 ] ; then echo "Trace checker error:" - python ./test/check_trace.py -v -in $test_name -ck $check_trace_flag + python3 ./test/check_trace.py -v -in $test_name -ck $check_trace_flag fi fi fi