HIP icon indicating copy to clipboard operation
HIP copied to clipboard

atomic increment and decrement functions

Open zjin-lcf opened this issue 3 years ago • 0 comments

Could ROCm consider adding the two functions in HIP ?

Reference: https://github.com/NVIDIA/cuda-samples/blob/master/Samples/0_Introduction/systemWideAtomics/systemWideAtomics.cu

main.cu:45:5: error: use of undeclared identifier 'atomicInc_system'; did you mean 'atomicAnd_system'?
    atomicInc_system((unsigned int *)&atom_arr[4], 17);
    ^~~~~~~~~~~~~~~~
    atomicAnd_system
/opt/rocm-4.5.2/hip/include/hip/amd_detail/amd_hip_atomic.h:562:14: note: 'atomicAnd_system' declared here
unsigned int atomicAnd_system(unsigned int* address, unsigned int val) {
             ^
main.cu:48:5: error: use of undeclared identifier 'atomicDec_system'
    atomicDec_system((unsigned int *)&atom_arr[5], 137);
    ^

zjin-lcf avatar Apr 26 '22 18:04 zjin-lcf