diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2012-04-27 16:27:57 -0400 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2012-04-27 16:27:57 -0400 |
commit | 80e104ead1f8e463c6fd35ba3faf7bae0e65380f (patch) | |
tree | 3ca190e00a19b990e251cf8309df3f3d82aafbb0 | |
parent | 8946be85b1f4000da5ad95f7179e85582276dba1 (diff) |
loop: Hoist code out of loop
-rw-r--r-- | loop.cl | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1,8 +1,9 @@ __kernel void loop(__global int * out, int iterations) { unsigned i; + unsigned base = get_global_id(0) * iterations; for (i = 0; i < iterations; i++) { - unsigned id = (get_global_id(0) * iterations) + i; + unsigned id = (base + i); out[id] = id; } } |