Ok, this is driving me crazy. I’m trying to use atomicInc to, you guessed it, atomically increment an integer.
Here’s the troublesome line, (which is more or less exacly as it appears in the programming guide version 2.2 page 109).
[codebox]unsigned int val = atomicInc((unsigned int*)&count, gridDim.x);[/codebox]
And here’s the error
[codebox]hvar_kernel.cuh(211): error: identifier “atomicInc” is undefined[/codebox]
Like I said I’m using the example from the programming guide, mentioned above, and I’ve also studied the simpleAtomicIntrinsics example from the SDK and I can’t see or find anything special in that code that I’m not doing already.
Any advice or suggestions as to why this might be happening would be much appreciated.
Ps… Thanks for the excellent forum, always helped me out in the past despite this being my first post… External Image
compile with -arch sm_11 or -arch sm_12 or whatever architecture you want–nvcc compiles to -arch sm_10 by default which does not support atomic operations
Thanks to both of you for your quick responses… I didn’t know that nvcc was 1.0 compute by default…
Adding “-arch sm_11” did it so I’m very grateful for that. Still a bit mystified to be honest since I don’t see any compile flags in the Makefile of simpleAtomicIntrinsics and that compiles and runs fine… Whatever, another little mystery solved.
I note that you’re both NVidia staffers, do you know what the deal is with registering as a CUDA developer is? I’ve tried a few times over the last few months and heard nothing back…