Will this kernel create branching?

Hi guys,

I have a kernel like this

kernel void k1(global int * a, global int * b, global int * c){
  int i = get_local_id(0);
  global int* ptr;
  if (i==0) ptr = &a[0];
  if (i==1) ptr = &b[0];
  if (i==2) ptr = &c[0];
  if (i>2) return;
  ptr[0]++;

}

My question is, will the line ptr[0]++ create branching in accessing memory? or will this save time compared to
a[0]++;b[0]++;c[0]++; within same workitem.

Thanks for your time.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.