11#! /usr/bin/env bash
22set -euo pipefail
33
4- xml_escape () { sed -e ' s/&/\&/g' -e ' s/</\</g' -e ' s/>/\>/g' ; }
54compare_files () {
65 local f1=" $1 " f2=" $2 " log=" ${3:- diff_log.txt} "
76 : > " $log " # ensure the log file exists
@@ -11,7 +10,19 @@ compare_files() {
1110
1211source " $( dirname " $0 " ) " /../util/args.sh " $@ "
1312
14- cd " ${OUT_DIR} /rodinia_suite/rodinia_suite/cuda"
13+ REPO_ROOT=" $PWD "
14+ if OUT_ABS=" $( readlink -f " $OUT_DIR " 2> /dev/null) " ; then : ; \
15+ elif OUT_ABS=" $( realpath " $OUT_DIR " 2> /dev/null) " ; then : ; \
16+ else OUT_ABS=" $REPO_ROOT /$OUT_DIR " ; fi
17+
18+ RESULTS_DIR=" $OUT_ABS /rodinia_suite"
19+ mkdir -p " $RESULTS_DIR "
20+ JUNIT=" $RESULTS_DIR /rodinia.xml"
21+ TMPCASE=" $RESULTS_DIR /.cases.tmp"
22+ : > " $TMPCASE "
23+ echo " Writing JUnit to: $JUNIT "
24+
25+ cd " $OUT_ABS /rodinia_suite/rodinia_suite/cuda"
1526
1627export SCALE_EXCEPTIONS=2
1728
@@ -20,13 +31,6 @@ benchmarks=(backprop bfs b+tree cfd dwt2d gaussian heartwall hotspot hotspot3D h
2031total=${# benchmarks[@]}
2132passed=0 failed=0 skipped=0
2233
23- # Results/JUnit output
24- RESULTS_DIR=" ${OUT_DIR} /rodinia_suite"
25- mkdir -p " $RESULTS_DIR "
26- JUNIT=" $RESULTS_DIR /rodinia.xml"
27- TMPCASE=" $RESULTS_DIR /.cases.tmp"
28- : > " $TMPCASE "
29-
3034echo " [===================]"
3135
3236for b in " ${benchmarks[@]} " ; do
@@ -53,13 +57,13 @@ for b in "${benchmarks[@]}"; do
5357 compare_files " $FILE1 " " $FILE2 " " $DIFFLOG " || rc=$?
5458 if (( rc == 0 )) ; then
5559 (( ++ passed))
56- printf ' <testcase classname="rodinia" name="%s" time="%s sec "/>\n' \
60+ printf ' <testcase classname="rodinia" name="%s" time(sec) ="%s"/>\n' \
5761 " $b " " $sec " >> " $TMPCASE "
5862 else
5963 (( ++ failed))
6064 short_ms=$( awk -v ms=" ${ms:- 0} " ' BEGIN{printf "%.2f", ms+0}' )
6165 # No embedded diff; just a short message pointing to the diff file
62- printf ' <testcase classname="rodinia" name="%s" time="%s sec "><failure message="Output mismatch (see %s; avg %s ms)"/></testcase>\n' \
66+ printf ' <testcase classname="rodinia" name="%s" time(sec) ="%s"><failure message="Output mismatch (see %s; avg %s ms)"/></testcase>\n' \
6367 " $b " " $sec " " $( basename " $DIFFLOG " ) " " $short_ms " >> " $TMPCASE "
6468 fi
6569 echo " [ AVG GPU time ] ${ms:- 0} ms"
0 commit comments