28 auto const old = *addr;
31# pragma GCC diagnostic push
32# pragma GCC diagnostic ignored "-Wconversion"
37# pragma GCC diagnostic pop
50 auto const old = *addr;
53# pragma GCC diagnostic push
54# pragma GCC diagnostic ignored "-Wconversion"
58# pragma GCC diagnostic pop
72 auto const old = *addr;
74 ref = std::min(ref, value);
87 auto const old = *addr;
89 ref = std::max(ref, value);
102 auto const old = *addr;
119 auto const old = *addr;
121 ref = ((old >= value) ?
static_cast<T
>(0) :
static_cast<T
>(old +
static_cast<T
>(1)));
136 auto const old = *addr;
138 ref = (((old ==
static_cast<T
>(0)) || (old > value)) ? value :
static_cast<T
>(old -
static_cast<T
>(1)));
151 auto const old = *addr;
166 auto const old = *addr;
181 auto const old = *addr;
194 template<
typename T, std::enable_if_t<!std::is_
floating_po
int_v<T>,
bool> = true>
197 auto const old = *addr;
201 ref = ((old == compare) ? value : old);
208 template<
typename T, std::enable_if_t<std::is_
floating_po
int_v<T>,
bool> = true>
211 static_assert(
sizeof(T) == 4u ||
sizeof(T) == 8u,
"Cas is supporting only 32bit and 64bit values!");
213 using BitType = std::conditional_t<
sizeof(T) == 4u,
unsigned int,
unsigned long long>;
226 auto const old = *addr;
233 ref = ((o.r == c.r) ? value : old);
#define ALPAKA_FN_HOST_ACC
All functions that can be used on an accelerator have to be attributed with ALPAKA_FN_ACC or ALPAKA_F...
#define ALPAKA_NO_HOST_ACC_WARNING
Disable nvcc warning: 'calling a host function from host device function.' Usage: ALPAKA_NO_HOST_ACC_...
Contains functors with operation following the atomic operation semantics.
The addition function object.
ALPAKA_FN_HOST_ACC auto operator()(T *const addr, T const &value) const -> T
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto operator()(T *const addr, T const &value) const -> T
The compare and swap function object.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto operator()(T *addr, T const &compare, T const &value) const -> T
Cas for non floating point values.
The decrement function object.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto operator()(T *const addr, T const &value) const -> T
Decrement down to 0, then reset to value.
The exchange function object.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto operator()(T *const addr, T const &value) const -> T
The increment function object.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto operator()(T *const addr, T const &value) const -> T
Increments up to value, then reset to 0.
The maximum function object.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto operator()(T *const addr, T const &value) const -> T
The minimum function object.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto operator()(T *const addr, T const &value) const -> T
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto operator()(T *const addr, T const &value) const -> T
The subtraction function object.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto operator()(T *const addr, T const &value) const -> T
The exclusive or function object.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto operator()(T *const addr, T const &value) const -> T