exchange

exchange#

stdgpu: stdgpu::atomic_ref::exchange
stdgpu Latest
Efficient STL-like Data Structures on the GPU

◆ exchange()

template<typename T >
STDGPU_DEVICE_ONLY T stdgpu::atomic_ref< T >::exchange ( const T  desired,
const memory_order  order = memory_order_seq_cst 
)
noexcept

Atomically exchanges the current value with the given value.

Parameters
[in]desiredThe value to exchange with the atomic object
[in]orderThe memory order
Returns
The old value