summaryrefslogtreecommitdiff
path: root/kernels/compiler_bool_cross_basic_block.cl
blob: 9aeb16dc10081e750f04cb9595f9d9a207c86dee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
__kernel
void compiler_bool_cross_basic_block(__global int *src,
				     __global int *dst,
				     int scale){
  int id = (int)get_global_id(0);

  bool isRedRow = false;
  bool isRed;
  int val = src[id];
  for (unsigned int i=0; i<scale; i++, isRedRow = !isRedRow) {
    if (isRedRow) {
      isRed= false;
      for (unsigned int j=0; j < scale; j++, isRed=!isRed) {
        if (isRed) {
	  val++;
        }
      }
    }
  }
  dst[id] = val;
}