hcc icon indicating copy to clipboard operation
hcc copied to clipboard

Atomic scope

Open syifan opened this issue 8 years ago • 4 comments

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?

syifan avatar Aug 03 '17 15:08 syifan

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 avatar Aug 21 '17 19:08 jvesely

@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?

syifan avatar Sep 28 '17 17:09 syifan

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.

jvesely avatar Sep 29 '17 05:09 jvesely

you can check the discussion here: https://reviews.llvm.org/D39350 looks like system scope atomics are not supported on dGPUs

jvesely avatar Oct 30 '17 15:10 jvesely