gpucoder.atomicXor
Atomically perform bit-wise XOR between value and variable in global or shared memory
Since R2021b
Description
The gpucoder.atomicXor function reads a value from a global or
shared GPU memory location, performs bit-wise XOR with 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 = gpucoder.atomicXor(
perform bit-wise XOR between A,B)B and the value of A and
writes the results back into A.
Call
the gpucoder.atomicXor function directly inside a for-loop that
you want to execute on the GPU in the generated CUDA® code. Each iteration of the loop must be able to read and write to
A.
[A,oldA] = gpucoder.atomicXor(
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.atomicXor.
Examples
Input Arguments
Extended Capabilities
Version History
Introduced in R2021b