...are just mentioned in the PTX manual. There is no hint about what they are good for or how to use them.
Does anyone know more? Am I just missing a common concept?
...are just mentioned in the PTX manual. There is no hint about what they are good for or how to use them.
Does anyone know more? Am I just missing a common concept?
Copyright © 2021 Jogjafile Inc.
Bart's comment is basically right. In more detail, as stated in the PTX ISA 3.1 manual,
There is actually only one class of instruction listed in the 3.1 PTX spec for which
_
is a valid destination:atom
. Here are the semantics ofatom
:And there is a note for
atom
:So, we can construct an example:
This would add 4 to the signed integer at memory location
a
, and not return the previous value of locationa
in a register. So if you don't need the previous value, you can use this. I assume that the compiler would generate this for this codesince the return value of atomicAdd is not stored to a variable.