summaryrefslogtreecommitdiff
path: root/kernels/compiler_unstructured_branch3.cl
blob: 67b47610e016d171676c3f88812af37145340c45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
__kernel void
compiler_unstructured_branch3(__global int *src, __global int *dst)
{
  int id = (int)get_global_id(0);
  dst[id] = src[id];
  if (dst[id] >= 2) goto label1;
  dst[id] = 1;
  if (src[id] < 2) goto label2;
  dst[id]--;
  label1:
  dst[id] -= 2;
  label2:
  dst[id] += 2;
}