summaryrefslogtreecommitdiff
path: root/kernels/compiler_mixed_pointer.cl
blob: 78c5783504e764ad193cd0e4aaf95d315724fb99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

kernel void compiler_mixed_pointer(__global uint* src1, __global uint *src2, __global uint *dst) {
  int x = get_global_id(0);
  global uint * tmp = NULL;

  switch(x) {
    case 0:
    case 1:
    case 4:
      tmp = src1;
      break;
    default:
      tmp = src2;
      break;
  }
  dst[x] = tmp[x];
}

kernel void compiler_mixed_pointer1(__global uint* src, __global uint *dst1, __global uint *dst2) {
  int x = get_global_id(0);
  global uint * tmp = x < 5 ? dst1 : dst2;
  tmp[x] = src[x];
}