unsigned int
atomic_xchg
(
| volatile __global unsigned int *p , |
unsigned int val) |
unsigned int
atomic_xchg
(
| volatile __local unsigned int *p , |
unsigned int val) |
Swaps the old
value stored at location p
with
new value given by val
. The function returns old
.
A 64-bit version of this function, atom_xchg, is enabled by cl_khr_int64_base_atomics.