atomic_[op]
#
Header File: <Kokkos_Core.hpp>
Usage#
atomic_[op](ptr_to_value,update_value);
Atomically updates the value
at the address given by ptr_to_value
with update_value
according to the relevant operation.
Description#
-
template<class T>
void atomic_add(T *const ptr_to_value, const T value);# Atomically executes
*ptr_to_value += value
.ptr_to_value
: address of the to be updated value.value
: value to be added.
-
template<class T>
void atomic_and(T *const ptr_to_value, const T value);# Atomically executes
*ptr_to_value &= value
.ptr_to_value
: address of the to be updated value.value
: value with which to combine the original value.
-
template<class T>
void atomic_decrement(T *const ptr_to_value);# Atomically executes
(*ptr_to_value)--
or callsatomic_fetch_sub(ptr_to_value, T(-1))
.ptr_to_value
: address of the to be updated value.
-
template<class T>
void atomic_increment(T *const ptr_to_value);# Atomically executes
(*ptr_to_value)++
or callsatomic_fetch_add(ptr_to_value, T(1))
.ptr_to_value
: address of the to be updated value.
-
template<class T>
void atomic_max(T *const ptr_to_value, const T value);# Atomically executes
if (value > *ptr_to_value) *ptr_to_value = value
.ptr_to_value
: address of the to be updated value.value
: value which to take the maximum with.
-
template<class T>
void atomic_min(T *const ptr_to_value, const T value);# Atomically executes
if (value < *ptr_to_value) *ptr_to_value = value
.ptr_to_value
: address of the to be updated value.value
: value which to take the minimum with.