Thanks okebz ,
So , if my write as follows , is it the same things ?
===========================================
void tempA( ...) {...};
void tempB( ...) {...};
void processing(global int *a , int *b){
if(a == 0)
tempA( a ,b);
else
tempB( a ,b);
}
__attribute__((num_simd_work_items(2)))
__attribute__((reqd_work_group_size(256,1,1)))
kernel void test (__global int * a ) // NDR
{
int gid = get_gloabla_gid(0);
int b ;
while ( b ==0 )
processing(&a[gid] , &b );
}
=================================
But if my program flow is as previously said , how to optimize this code ?
Each workitem stays in while loop until condition is matched.
Is it better to use task instead of NDR ?
Regards .,