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