exchange

exchange#

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

◆ exchange()

template<typename T , typename Allocator = safe_device_allocator<T>>
STDGPU_DEVICE_ONLY T stdgpu::atomic< T, Allocator >::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