atomic function do not support volatile parameter ?

if a kernel uses a volatile parameter like so:

func ( volatile int *Memory )

then atomics cannot be used:

atomicInc( &Memory[SomeWhere], 0 );

^ cuda compiler will claim mismatch between volatile int * and int * or something like that ;)

Is there a reason why it cannot support volatile… or is this just a little type mismatch/overloading/different versions issue ? ;)

I believe that it would probably be safe to use const_cast in this instance…

template <typename T>
T atomicInc(volatile T* addr, T inc)
{
    return atomicInc(const_cast<T*>(addr), inc);
}