How do I use atomicMax on floating-point values in CUDA?
cuda, nvidia
Solution
The short answer is that you can't. As you can see from the atomic function documentation, only integer arguments are supported for `atomicMax` and 64 bit integer arguments are only supported on compute capability 3.5 devices.
Problem
I have used `atomicMax()` to find the maximum value in the CUDA kernel: ``` __global__ void global_max(float* values, float* gl_max) { int i=threadIdx.x + blockDim.x * blockIdx.x; float val=values[i]; atomicMax(gl_max, val); } ``` It is throwing the following error: error: no instance of overloaded function "atomicMax" matches the argument list The argument types are: `(float *, float)`.