Difference between RED and ATOMG sass instruction

if i use atomicADD function’s return value:

 res = atomicAdd(&input[0], 1);

the sass instruction is ATOMG.E.ADD.STRONG.GPU;
if i do not use return vallue,the sass instruction is RED.E.ADD.STRONG.GPU:

atomicAdd(&input[0], 1);

i found definition of these two instruction:
ATOMG Atomic Operation on Global Memory
RED Reduction Operation on Generic Memory
so, what’s the detail difference between these two instructionss, can anyone help me?
thanks in advance

The difference is exactly what you indicated.

They both do the same thing as far as the atomic update of the location is concerned. If you use the return value, then you get one of the SASS instructions. If you don’t you get the other.

There’s obviously some undocumented significance to this. Since the return value must be set, an atomic that provides a return value will have the possibility for different warp stall scenarios as compared to one that doesn’t. Presumably, the atomic mechanism may behave somewhat differently if the return value is required as compared to if it is not.

I don’t think you’ll find any documentation describing the detailed difference. What I’m posting here is mainly observation and conjecture.

ok, thank you for reply.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.