summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2012-03-16 14:44:28 -0400
committerTom Stellard <thomas.stellard@amd.com>2012-03-16 14:44:28 -0400
commit50aa34ce7a13dfdb6c2c7ca87c57fce1e2f1ba01 (patch)
tree12d9441bd35a2eb0ad38a3b9ae6a898378e475e6
parent061ffcad78e9dd6bf9efccdeb3ce27bcd7606c00 (diff)
Add tests for if (x > y)
-rw-r--r--if_gt.cl7
-rw-r--r--run_tests.sh16
2 files changed, 23 insertions, 0 deletions
diff --git a/if_gt.cl b/if_gt.cl
new file mode 100644
index 0000000..1ffed51
--- /dev/null
+++ b/if_gt.cl
@@ -0,0 +1,7 @@
+__kernel void if_gt(__global int * out, int arg0, int arg1)
+{
+ out[0] = 0;
+ if (arg0 > arg1) {
+ out[0] = 1;
+ }
+}
diff --git a/run_tests.sh b/run_tests.sh
index 5f2e461..42f21cb 100644
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -117,5 +117,21 @@ run_test "./get-global-id 2000000 1"
#Large number of threads
run_test "./get-global-id 5000000 1000"
+################################################################################
+#if (x > y) #
+################################################################################
+
+#True case
+run_test "./math-int if_gt 5 4 1"
+#False case
+run_test "./math-int if_gt 5 6 0"
+# x < y but abs(x) > y
+run_test "./math-int if_gt -20 10 0"
+# x < y and abs(x) > y
+run_test "./math-int if_gt -5 8 0"
+# x > y, but x < abs(x)
+run_test "./math-int if_gt 12 -15 1"
+# x > y and x > abs(y)
+run_test "./math-int if_gt 16 -3 1"
echo "$PASS passes, $FAIL fails"