summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2012-08-01 13:42:19 +0000
committerTom Stellard <thomas.stellard@amd.com>2012-08-01 13:42:19 +0000
commit1346675bd96de1f4cc882ab16966c78904aaa117 (patch)
treea2d308523a37046e99e2d284d37c17426a22a9a1
parent35db7e8ae4fe384199b8101609fe68ea4977c762 (diff)
Fix bugs in loop_g{e,t} tests.
-rw-r--r--KNOWN_FAILURES2
-rw-r--r--loop_ge.cl6
-rw-r--r--loop_gt.cl6
3 files changed, 6 insertions, 8 deletions
diff --git a/KNOWN_FAILURES b/KNOWN_FAILURES
index 9f39951..e69de29 100644
--- a/KNOWN_FAILURES
+++ b/KNOWN_FAILURES
@@ -1,2 +0,0 @@
-./loop loop_gt 10
-./loop loop_ge 10
diff --git a/loop_ge.cl b/loop_ge.cl
index 119d7be..bc187ca 100644
--- a/loop_ge.cl
+++ b/loop_ge.cl
@@ -1,8 +1,8 @@
-__kernel void loop_ge(__global int * out, unsigned iterations)
+__kernel void loop_ge(__global int * out, int iterations)
{
- unsigned i;
+ int i;
unsigned base = get_global_id(0) * iterations;
- for (i = iterations; i >= 1; i--) {
+ for (i = iterations - 1; i >= 0; i--) {
unsigned id = (base + i);
out[id] = id;
}
diff --git a/loop_gt.cl b/loop_gt.cl
index df43ac4..4e7dffe 100644
--- a/loop_gt.cl
+++ b/loop_gt.cl
@@ -1,8 +1,8 @@
-__kernel void loop_gt(__global int * out, unsigned iterations)
+__kernel void loop_gt(__global int * out, int iterations)
{
- unsigned i;
+ int i;
unsigned base = get_global_id(0) * iterations;
- for (i = iterations; i > 0; i--) {
+ for (i = iterations - 1; i > -1; i--) {
unsigned id = (base + i);
out[id] = id;
}