fetch_max

fetch_max#

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

◆ fetch_max()

template<typename T >
template<STDGPU_DETAIL_OVERLOAD_IF(std::is_integral_v< T >||std::is_floating_point_v< T >) >
STDGPU_DEVICE_ONLY T stdgpu::atomic_ref< T >::fetch_max ( const T  arg,
const memory_order  order = memory_order_seq_cst 
)
noexcept

Atomically computes and stores the maximum of the stored value and the given argument.

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