gpucoder.atomicSub
Description
The gpucoder.atomicSub function reads a value from a global or
shared GPU memory location, subtracts from the value, and writes the result back to the memory
location. In generated GPU
code, the operation is atomic, which means that a GPU thread performs the
read-modify-write operation without interference from other threads.
[A,oldA] = gpucoder.atomicSub(
returns
the previous value of A,B)A as oldA. When you use this syntax,
use the coder.gpu.kernel pragma before the loop that contains
gpucoder.atomicSub.
Examples
Input Arguments
Extended Capabilities
Version History
Introduced in R2021b