Skip to content

Instantly share code, notes, and snippets.

@PolarNick239
Last active December 29, 2016 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PolarNick239/5e370892989800fe42154145911b141f to your computer and use it in GitHub Desktop.
Save PolarNick239/5e370892989800fe42154145911b141f to your computer and use it in GitHub Desktop.
CUDA atomicCAS for float32
__device__ float atomicCAS_f32(float *p, float cmp, float val) {
return __int_as_float(atomicCAS((int *) p, __float_as_int(cmp), __float_as_int(val)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment