atomic_exchange_explicit

atomic_exchange_explicit#

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

◆ atomic_exchange_explicit()

template<typename T , typename Allocator >
STDGPU_DEVICE_ONLY T stdgpu::atomic_exchange_explicit ( atomic< T, Allocator > *  obj,
const typename atomic< T, Allocator >::value_type  desired,
const memory_order  order 
)
noexcept

Atomically exchanges the current value with the given value.

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