Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Journeyman III

Floating-point atomic add, is this supported by OpenCL now?

Floating point atomic operations are not supported, at least in OpenCL 1.2 or earlier, I have to use the atomic_xchg hack other people proposed. see

I am wondering if there is any official/unofficial support of floating point atomic functions? or atomc_xchg is currently the only way to use with opencl? can't imagine such important operators are still not supported.

1 Reply

Atomic Functions - OpenCL1.2 says: "Only the atomic_xchg operation is supported for single precision floating-point data type."

Here is a nice article which shows how atomic_cmpxchg can be used to implement other atomic functions for float : Atomic operations for floats in OpenCL - improved - StreamHPC