error using AtomicCAS

Hi guys

Im trying to implement a code which uses the atomicCAS and atomicExch function, but the compiler gives me an error in that lines.

it says,

error: identifier “atomicExch” is undefined
error: identifier “atomicCAS” is undefined

In the cuda programming guide says that I can use this functions if my device has compute capability > 1.1

“Atomic functions are only available for devices of compute capability 1.1 and above”.

I have a Tesla C1060, with compute capability 1.3

I have tried to compile with the option nvcc -arch=sm_11 and 13, but I get the same error.

So, why can not I use this functions into my code?

Thanks in advance


I have found that using the directive

#if CUDA_ARCH >= 110


can solve my problem.


It is not really clear to me why do you need

#if __CUDA_ARCH__ >= 110

if you compile with -arch=sm_13.

Hello guys,
I working cuda 5.0 on vs 2010 and windows 7. I use also opengl and opencv library . like you said that ı compile my project ı get this error message(error : identifier “atomicExch” is undefined). I do you said but it didn’t work. How do ı solve this problem?