This repository has been archived by the owner on Apr 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Kokkos::atomic_op
Damien L-G edited this page Dec 9, 2021
·
5 revisions
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.
template<class T>
void atomic_add(T* const ptr_to_value, const T value);
template<class T>
void atomic_and(T* const ptr_to_value, const T value);
template<class T>
void atomic_assign(T* const ptr_to_value, const T value);
template<class T>
void atomic_decrement(T* const ptr_to_value);
template<class T>
void atomic_incrememt(T* const ptr_to_value);
template <class T>
void atomic_max(T* const ptr_to_value, const T value);
template <class T>
void atomic_min(T* const ptr_to_value, const T value);
template<class T>
void atomic_or(T* const ptr_to_value, const T value);
template<class T>
void atomic_sub(T* const ptr_to_value, const T value);
-
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_assign(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
: new 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.
-
-
template<class T> void atomic_or(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_sub(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 substracted..
-
Home:
- Introduction
- Machine Model
- Programming Model
- Compiling
- Initialization
- View
- Parallel Dispatch
- Hierarchical Parallelism
- Custom Reductions
- Atomic Operations
- Subviews
- Interoperability
- Kokkos and Virtual Functions
- Initialization and Finalization
- View
- Data Parallelism
- Execution Policies
- Spaces
- Task Parallelism
- Utilities
- STL Compatibility
- Numerics
- Detection Idiom