operator+=

operator+=#

stdgpu: stdgpu::atomic_ref::operator+=
stdgpu Latest
Efficient STL-like Data Structures on the GPU

◆ operator+=()

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 >::operator+= ( const T  arg)
noexcept

Computes the atomic addition with the argument. Equivalent to fetch_add(arg) + arg.

Parameters
[in]argThe other argument of addition
Returns
The new value