Compiling 64-bit Atomics Please Help!

Looks like a very stupid problem, but can’t seem to find solutions anywhere!

I have code which calls atomicExch on long long ints. As of compute 1.2, this is possible, but trying to make the code results in the following error:

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

            argument types are: (long long *, long long)

I’ve defined the source file to be CUFILES_sm_12 in the project Makefile. Just to clear up things, 32 bit atomic operations are working fine. Why am I having so much trouble with this? I’m working with latest cuda driver, toolkit and SDK, I’m trying to run the code on the GTX280.

Any help will be appreciated, I need to wrap up this project asap, I’m just stuck on this single issue.

Looking at the reference manual, 64 bit atomics use unsigned long longs.
That seems strange, but that’s what it says…
so your answer is likely as simple as a costless cast to just get the compiler to recognize it. You’re providing a “long long” but the compiler only has prototypes for “unsigned long long”.

int atomicExch(int*address,int val);
unsigned int atomicExch(unsigned int *address,unsigned int val);
unsigned long long int atomicExch(unsigned long long int *address, unsigned long long int val);

Like i said, it was a stupid problem :blink: , I just needed to cast the variables, it worked fine! Thanks