summaryrefslogtreecommitdiff
path: root/kernels/compiler_unstructured_branch0.cl
diff options
context:
space:
mode:
authorBenjamin Segovia <segovia.benjamin@gmail.com>2012-05-03 19:34:44 +0000
committerKeith Packard <keithp@keithp.com>2012-08-10 16:17:02 -0700
commit01adf44d28690d2d5276e3bccc93184d41e84b13 (patch)
tree4f0548f23dfa3f7615e86535a61dc2b484f9fb24 /kernels/compiler_unstructured_branch0.cl
parente6b061c78e0ef385f8e9bd3d6d1708c95575bfd3 (diff)
Added several tests for unstructured branches
Diffstat (limited to 'kernels/compiler_unstructured_branch0.cl')
-rw-r--r--kernels/compiler_unstructured_branch0.cl14
1 files changed, 14 insertions, 0 deletions
diff --git a/kernels/compiler_unstructured_branch0.cl b/kernels/compiler_unstructured_branch0.cl
new file mode 100644
index 00000000..66da6e02
--- /dev/null
+++ b/kernels/compiler_unstructured_branch0.cl
@@ -0,0 +1,14 @@
+__kernel void
+compiler_unstructured_branch0(__global int *src, __global int *dst)
+{
+ int id = (int)get_global_id(0);
+ dst[id] = src[id];
+ if (dst[id] >= 0) goto label;
+
+ do {
+ dst[id] = 1;
+ label:
+ id += get_local_size(0);
+ } while (id < 32);
+}
+