Skip to content

Commit

Permalink
ocl: fixed, improved and relocated script
Browse files Browse the repository at this point in the history
* Improved printing FAILED cases.
  • Loading branch information
hfp committed Jul 9, 2024
1 parent c177674 commit 0cffc63
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
5 changes: 4 additions & 1 deletion src/acc/opencl/smm/tune_multiply.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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):
Expand Down

0 comments on commit 0cffc63

Please sign in to comment.