cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

dheevatsa
Journeyman III

atom_add on 5870 with Stream SDK 2.0beta4

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 !!

0 Likes
7 Replies
n0thing
Journeyman III

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);

}

0 Likes

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

 

0 Likes

Hmm..I am not sure beta4 supports local and global atomics, you should try the latest SDK release.

0 Likes

beta4 support atomics only on CPU. upgrade to final.

0 Likes

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 ...

0 Likes

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.

0 Likes

are u using stream SDK v2.0 final ?

0 Likes