1 #ifndef DASH__ATOMIC_OPERATION_H_ 2 #define DASH__ATOMIC_OPERATION_H_ 4 #include <dash/atomic/GlobAtomicRef.h> 56 return ref.exchange(value);
71 return ref.compare_exchange(expected, desired);
82 const BinaryOp binary_op,
86 ref.op(binary_op, value);
100 const BinaryOp binary_op,
104 return ref.fetch_op(binary_op, value);
111 typename std::enable_if<
112 std::is_integral<T>::value,
125 typename std::enable_if<
126 std::is_integral<T>::value,
139 typename std::enable_if<
140 std::is_integral<T>::value,
157 typename std::enable_if<
158 std::is_integral<T>::value,
165 return ref.fetch_add(value);
175 typename std::enable_if<
176 std::is_integral<T>::value,
183 return ref.fetch_sub(value);
189 #endif // DASH__ATOMIC_OPERATION_H_ This class is a simple memory pool which holds allocates elements of size ValueType.
Type wrapper to mark any trivial type atomic.
std::enable_if< std::is_integral< T >::value, T >::type fetch_sub(const dash::GlobRef< dash::Atomic< T >> &ref, const T &value)
Atomic fetch-and-sub operation on the referenced shared value.
std::enable_if< std::is_integral< T >::value, void >::type multiply(const dash::GlobRef< dash::Atomic< T >> &ref, const T &value)
Atomic multiply operation on the referenced shared value.
std::enable_if< std::is_integral< T >::value, void >::type add(const dash::GlobRef< dash::Atomic< T >> &ref, const T &value)
Atomic add operation on the referenced shared value.
void op(const dash::GlobRef< dash::Atomic< T >> &ref, const BinaryOp binary_op, const T &value)
Atomically executes specified operation on the referenced shared value.
std::enable_if< std::is_integral< T >::value, T >::type fetch_add(const dash::GlobRef< dash::Atomic< T >> &ref, const T &value)
Atomic fetch-and-add operation on the referenced shared value.
T load(const dash::GlobRef< dash::Atomic< T >> &ref)
Get the value of the shared atomic.
std::enable_if< std::is_integral< T >::value, void >::type sub(const dash::GlobRef< dash::Atomic< T >> &ref, const T &value)
Atomic subtract operation on the referenced shared value.
T fetch_op(const dash::GlobRef< dash::Atomic< T >> &ref, const BinaryOp binary_op, const T &value)
Atomic fetch-and-op operation on the referenced shared value.
bool compare_exchange(const dash::GlobRef< dash::Atomic< T >> &ref, const T &expected, const T &desired)
Atomically compares the value with the value of expected and if those are bitwise-equal, replaces the former with desired.
void store(const dash::GlobRef< dash::Atomic< T >> &ref, const T &value)
Set the value of the atomic reference.
T exchange(const dash::GlobRef< dash::Atomic< T >> &ref, const T &value)
Atomically sets the value of the atomic reference and returns the old value.