atomicAdd for floating point operations how to specify sm_20 arch

hi

I have read that to use atomicAdd for floating point operations in gpu with compute capability 2.x, we have to specify sm_20 arch.
Someone please aid me to do this. I am using VS 2008, win 7 64 bit.
I was using “simpleAtomicIntrinsics” example from sdk . It works if I use atomics for integers.
When I give floating point numbers the compiler gives the following error

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1>------ Build started: Project: simpleAtomicIntrinsics, Configuration: Debug x64 ------

1>Compiling with CUDA Build Rule…

1>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\bin\nvcc.exe” -gencode=arch=compute_11,code=“sm_11,compute_11” -gencode=arch=compute_20,code=“sm_20,compute_20” --machine 64 -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin” -Xcompiler “/EHsc /W3 /nologo /Od /Zi /MTd " -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2/include” -I"./" -I"…/…/common/inc" -I"…/…/…/shared/inc" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\include" -maxrregcount=32 --compile -o “x64\Debug/simpleAtomicIntrinsics.cu.obj” simpleAtomicIntrinsics.cu

1>simpleAtomicIntrinsics.cu

c:/ProgramData/NVIDIA Corporation/NVIDIA GPU Computing SDK 3.2/C/src/simpleAtomicIntrinsics/simpleAtomicIntrinsics.cu(86): error: no instance of overloaded function “atomicAdd” matches the argument list

1> argument types are: (float *, float)

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

someone please help me to fix this.

Each time a description of the change, there is always plenty to talk about around the world. They are not exempt. A statement usually is: "i have to change almost immediately versions, so do not expect me to date continue to attack …

Can you post the code you are trying to use? It sounds like you are feeding atomicAdd the wrong arguments.

Sorry to bump an old topic, but i’ve got the same problem here.
I added “-arch=sm_20” to Project > Properties > CUDA C/C++ > Command line > Additional Options, but it won’t work.
Is there anything else ?

In VC …property pages …go to CUDA Runtime API/GPU…and select the device archi…

Okay ! You’re sure it’s the problem ? Else I’ll be totally stuck tuesday at work :s
Thank you

Well sadly, it doesn’t work. I don’t have “CUDA Runtime API/GPU” but only “CUDA C/C++” in property pages, and if i go to Device > Code generation “compute_20,sm_20” doesn’t work.

The weird thing is, if I try “-arch=sm_11” it does tell me

error : no instance of overloaded function "atomicAdd" matches the argument list

argument types are: (float *, float)

which is fine,

but with “-arch=sm_20” I only have “error : identifier “atomicAdd” is undefined” …

What’s wrong : ( ?

EDIT : Okay, on VS2010 :

And don’t put “compute_20,sm_20;%CodeGeneration;” as I did !

Well sadly, it doesn’t work. I don’t have “CUDA Runtime API/GPU” but only “CUDA C/C++” in property pages, and if i go to Device > Code generation “compute_20,sm_20” doesn’t work.

The weird thing is, if I try “-arch=sm_11” it does tell me

error : no instance of overloaded function "atomicAdd" matches the argument list

argument types are: (float *, float)

which is fine,

but with “-arch=sm_20” I only have “error : identifier “atomicAdd” is undefined” …

What’s wrong : ( ?

EDIT : Okay, on VS2010 :

And don’t put “compute_20,sm_20;%CodeGeneration;” as I did !