I am not able to compile a kernel file (mykernel.cl) usign atom_add.
#pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics : enable
#pragma OPENCL EXTENSION cl_khr_local_int32_base_atomics : enable
__kernel mykernel ()
{
__local int * ptr;
atom_add (ptr, 1);
}
This doesn't work any reason why ?? Am i missing out on something here !!
You weren't using 'void' as kernel return type which was giving build errors.
#pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics : enable
#pragma OPENCL EXTENSION cl_khr_local_int32_base_atomics : enable
__kernel void mykernel()
{
__local int ptr[4];
atom_add(ptr, 1);
}
hey thanks taht was a typo in the post !! I have teh void return type in the code...the code compiles without the atom_add() function.
I have jsut posted a very cimplfied version fo teh kernel here....with only teh atom_add portion - I pinpointed this is the lien which is causing teh build failure
Hmm..I am not sure beta4 supports local and global atomics, you should try the latest SDK release.
beta4 support atomics only on CPU. upgrade to final.
thanks guys...it compiles now..i am not still able to get the code to work properly but, must be some bug from my side ...
Originally posted by: dheevatsa thanks guys...it compiles now..i am not still able to get the code to work properly but, must be some bug from my side ...
Dheevatsa,
Could you please post your code here so that we can help you? Please mention OS, CPU, GPU, SDK version and driver version.
are u using stream SDK v2.0 final ?