cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

FangQ
Adept I

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

https://github.com/fangq/mcxcl/blob/master/src/mcx_core.cl#L212-L215

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.

0 Likes
1 Reply
dipak
Big Boss

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