Open nHackel opened 2 months ago
On the issue of safety. This can lead to "torn" updates. E.g. one thread updating re one updating im. Since you are doing an accumulate that should be fine. We would need to support 16byte wide operations, but that would also turn your accumulate operation into a cmpswap loop.
As requested by @vchuravy, this is a copy of my slack question:
Hello, I'm running into an errors with KernelAbstractions.jl, atomic operations using Atomix.jl and complex numbers. Is it possible to somehow perform atomic operations on ComplexF32 ?
As MWE we can just take the atomic operations example from the documentation and create img as an array of ComplexF32:
On a GPU I get the error:
and on CPU I get:
Accessing the real and imag part individually like this:
results in such an error:
A fairly hacky workaround is reinterpret, but I'm not sure that is safe to do: