summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2012-03-06 10:19:18 -0500
committerTom Stellard <thomas.stellard@amd.com>2012-03-06 10:19:18 -0500
commitbef83647a9179560201fa969f5e67507f9f94974 (patch)
tree0697da3389ba636a07e2974a0d9dd99ddc2866fb
parentaf7d6638c2d7490013a53c0bea909786edb07634 (diff)
Add integer multiply tests
-rw-r--r--mul.cl4
-rw-r--r--run_tests.sh13
2 files changed, 17 insertions, 0 deletions
diff --git a/mul.cl b/mul.cl
new file mode 100644
index 0000000..009edbf
--- /dev/null
+++ b/mul.cl
@@ -0,0 +1,4 @@
+__kernel void mul(__global int * out, int arg0, int arg1)
+{
+ out[0] = arg0 * arg1;
+}
diff --git a/run_tests.sh b/run_tests.sh
index 4aca5d2..da77d7f 100644
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -27,4 +27,17 @@ run_test "./math-int add -5 10 5"
#Test negative plus negative
run_test "./math-int add -1 -4 -5"
+################################################################################
+#Integer Multiply #
+################################################################################
+
+#Test random multiply
+run_test "./math-int mul 4 5 20"
+#Test multiply by 0
+run_test "./math-int mul 8 0 0"
+#Test multiply negative by positive
+run_test "./math-int mul -3 8 -24"
+#Test multiply negative by negative
+run_test "./math-int mul -12 -6 72"
+
echo "$PASS passes, $FAIL fails"