Atomic operations with double, OpenCL
问题 I would like to know if there's a way to implement atomic operations (particularly atomic_add) with double type. For floats this code works, but atomic_xchg doesn't support double: while ((value = atomic_xchg(addr, atomic_xchg(addr, 0.0f)+value))!=0.0f); 回答1: I was looking for for the same in the past and I found this: https://github.com/ddemidov/vexcl-experiments/blob/master/sort-by-key-atomic.cpp. At the end I figured out different approach to my problem so I did not use it. Here is the