fetch_dec_mod

fetch_dec_mod#

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

◆ fetch_dec_mod()

template<typename T , typename Allocator = safe_device_allocator<T>>
template<STDGPU_DETAIL_OVERLOAD_IF(std::is_same_v< T, unsigned int >) >
STDGPU_DEVICE_ONLY T stdgpu::atomic< T, Allocator >::fetch_dec_mod ( const T  arg,
const memory_order  order = memory_order_seq_cst 
)
noexcept

Atomically computes and stores the decrementation of the value and modulus with arg.

Parameters
[in]argThe other argument of modulus
[in]orderThe memory order
Returns
The old value