Atomic scope
I am wondering what is the scope of the atomic operation in the hc namespace. HSA platform requires CPU that support system level atomic. So, is the atomic operation in C++ HC system level? Or it depends on the devices? If the atomic is not system level, is that possible to use system level atomic in C++ HC?
atomic operations are system level (i.e. work between CPU and GPU). I haven't tested dGPUs which require special flag for the atomic instructions. the following tests work as expected on carrizo APU: https://github.com/jvesely/hcc-atomic-test.git
@jvesely Thank you very much. Finally got a chance to test. The system level atomic works on APUs but not dGPUs. Do you know if there is any way to enable dGPU like R9 nano to support system level atomic? I know system level atomic is a requirement for the hardware to use ROCm, but as a user, can I use it?
Sounds like either l2$ configuration bug, or wrong code generated by the compiler (missing SLC flag for atomic instructions). Either way you'll need someone from AMD to address it.
you can check the discussion here: https://reviews.llvm.org/D39350 looks like system scope atomics are not supported on dGPUs