Atomic Functions for double precision

I have to implement Atomic add for double precisions but definitely CUDA doesn’t support them. Is there a way to workaround the problem with CUDA functions? I have seen some functions as__double_as_longlong, can these be used for this purpose?

Otherwise I would implement my own atomic functions :).

atomicAdd works only on integers. Adding two floats/doubles is much more complex, you have to handle base, exponent, sign bit etc, etc, while with integers it is a simple binary operation.

there is also no atomicMin/atomicMax but you can ‘cheat’ it by simply XORing everything except for sign bit for all negative floats and treating them as integers.

Thanks for the answer, I started implementin some atomic functions :).