AtomicMax Im getting error while compiling my code due to atomicMax

Hi this is Gururaj and Im new to CUDA,
recently I wrote a simple CUDA program to find the Max element in an array using atomicMax.

But Im getting an error as mentioned below:

error: no instance of overloaded function “atomicMax” matches the argument list
argument types are: (float, float).

Can anybody pls help me to solve this problem?

Thanks in advance

Guruaj

Hi this is Gururaj and Im new to CUDA,
recently I wrote a simple CUDA program to find the Max element in an array using atomicMax.

But Im getting an error as mentioned below:

error: no instance of overloaded function “atomicMax” matches the argument list
argument types are: (float, float).

Can anybody pls help me to solve this problem?

Thanks in advance

Guruaj

atomicMax doesn’t support floating point types. There are tricks to convert floats into a 32 bit representation which will compare correctly using integer logic, however if you want to find the maximum of a non-trivial number of floats, use a parallel reduction instead. It will be appreciably faster.

atomicMax doesn’t support floating point types. There are tricks to convert floats into a 32 bit representation which will compare correctly using integer logic, however if you want to find the maximum of a non-trivial number of floats, use a parallel reduction instead. It will be appreciably faster.