From 0cffc634db1171a7cddf2af3d925466ce79a1254 Mon Sep 17 00:00:00 2001 From: Hans Pabst Date: Tue, 9 Jul 2024 16:12:27 +0200 Subject: [PATCH] ocl: fixed, improved and relocated script * Improved printing FAILED cases. --- .../opencl/{acc_opencl_test.sh => smm/opencl_test.sh} | 10 ++++++---- src/acc/opencl/smm/tune_multiply.py | 5 ++++- 2 files changed, 10 insertions(+), 5 deletions(-) rename src/acc/opencl/{acc_opencl_test.sh => smm/opencl_test.sh} (80%) diff --git a/src/acc/opencl/acc_opencl_test.sh b/src/acc/opencl/smm/opencl_test.sh similarity index 80% rename from src/acc/opencl/acc_opencl_test.sh rename to src/acc/opencl/smm/opencl_test.sh index 03d6ba0300c..38d5065aec9 100755 --- a/src/acc/opencl/acc_opencl_test.sh +++ b/src/acc/opencl/smm/opencl_test.sh @@ -10,7 +10,7 @@ HERE="$(cd "$(dirname "$0")" && pwd -P)" TEST=acc_bench_smm -EXE=${HERE}/../${TEST} +EXE=${HERE}/../../${TEST} if [ ! -e "$1" ]; then >&2 echo "USAGE: $0 logfile" @@ -21,12 +21,14 @@ if [ ! -e "${EXE}" ]; then exit 1 fi -sed -n "s/FAILED: \(..*\)/\1/p" "$1" | while read -r LINE; do +sed -n "s/FAILED\[..*\] \(..*\): \(..*\)/\1 \2/p" "$1" | while read -r LINE; do + read -r MNK KEYVALS <<<"${LINE}" EXPORT="" - for KEYVAL in ${LINE}; do + for KEYVAL in ${KEYVALS}; do EXPORT="${EXPORT} OPENCL_LIBSMM_SMM_${KEYVAL}" done if [ "${EXPORT}" ]; then - eval "${EXPORT} ${EXE}" + OUTPUT=$(eval "${EXPORT} ${EXE} ${MNK} 2>&1" | sed "s/^/ /") + echo -e "${MNK}: ${KEYVALS}\n${OUTPUT}" fi done diff --git a/src/acc/opencl/smm/tune_multiply.py b/src/acc/opencl/smm/tune_multiply.py index b0dbc3f3cda..709b590d88d 100755 --- a/src/acc/opencl/smm/tune_multiply.py +++ b/src/acc/opencl/smm/tune_multiply.py @@ -301,6 +301,8 @@ def run(self, desired_result, input, limit): str(self.run_result["stdout"]), ) else: + if not returncode: + returncode = "?" performance = None if performance and performance.group(1) and performance.group(2): mseconds = float(performance.group(1)) @@ -322,7 +324,8 @@ def run(self, desired_result, input, limit): if not self.args.verbose else runcmd ) - print("FAILED ({}): {}".format(returncode, failed), flush=True) + mnk = "x".join(map(str, self.mnk)) + print("FAILED[{}] {}: {}".format(returncode, mnk, failed), flush=True) return Result(time=float("inf"), accuracy=0.0, size=100.0) def update_jsons(self, filenames):