summaryrefslogtreecommitdiff
path: root/tests.d
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-08-21 10:04:22 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-08-21 22:31:16 +0100
commita7dea24a917af23cad61411014d840907e19093b (patch)
tree5f10e88eb78739c0e7bafec9a6c0fdc9f56cca81 /tests.d
parent532160a802c0e6d6edd8083d38b3575e1528ae3b (diff)
tests: Add some more OpenCL benchmarks
Found some OpenCL tests courtesy of https://github.com/cavazos-lab/PolyBench-ACC
Diffstat (limited to 'tests.d')
-rw-r--r--tests.d/beignet/finance.test32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests.d/beignet/finance.test b/tests.d/beignet/finance.test
new file mode 100644
index 0000000..32c1872
--- /dev/null
+++ b/tests.d/beignet/finance.test
@@ -0,0 +1,32 @@
+# https://github.com/cavazos-lab/FinanceBench
+
+test -d ${FINANCEBENCH_FOLDER} || return 1
+
+# Typical output (Black-Scholes):
+# Number of options: 5000000
+#
+# number of platforms is 1
+# platform name is Intel Gen OCL Driver
+# platform version is OpenCL 1.2 beignet 1.2 (git-7b151ad)
+# number of devices is 1
+# device name is Intel(R) HD Graphics Haswell GT2 Desktop
+#
+# Run on GPU
+# Summation of all output prices on GPU: 30030504.000000
+# Output price for option 2500000 on GPU: 0.040781
+# Processing time on GPU: 47.405998
+
+__finance__() {
+ cd $(dirname $2)
+ for (( c=0; c<$1; c++ )); do
+ ./$(basename $2) | sed '/Processing time/!d; s/.*://' || return 1
+ done
+}
+
+for exe in $(find ${FINANCEBENCH_FOLDER} -name '*.exe'); do
+ name=$(sed "s#${FINANCEBENCH_FOLDER}/\([^/]*\).*#\1#" <<< $exe)
+ test_name="$test_name finance:$name"
+ eval "finance:${name}_run() { __finance__ \$1 $exe; }"
+done
+test_exec_time=2
+test_invert=1 # output is duration in milliseconds