1 #ifndef HeterogeneousCore_AlpakaCore_interface_atomicMaxPair_h 2 #define HeterogeneousCore_AlpakaCore_interface_atomicMaxPair_h 3 #include <alpaka/alpaka.hpp> 9 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>,
typename F>
11 unsigned long long int* address,
12 std::pair<unsigned int, float>
value,
14 #if defined(__CUDA_ARCH__) or defined(__HIP_DEVICE_COMPILE__) 15 unsigned long long int val = (
static_cast<unsigned long long int>(
value.first) << 32) + __float_as_uint(
value.second);
16 unsigned long long int ret = *address;
17 while (comparator(
value,
18 std::pair<unsigned int, float>{
static_cast<unsigned int>(
ret >> 32 & 0xffffffff),
19 __uint_as_float(
ret & 0xffffffff)})) {
20 unsigned long long int old =
ret;
25 unsigned long long int val =
26 (
static_cast<unsigned long long int>(
value.first) << 32) + edm::bit_cast<
unsigned int>(
value.second);
27 unsigned long long int ret = *address;
28 while (comparator(
value,
29 std::pair{
static_cast<unsigned int>(
ret >> 32 & 0xffffffff),
30 edm::bit_cast<float>(static_cast<unsigned int>(
ret & 0xffffffff))})) {
31 unsigned long long int old =
ret;
32 if ((
ret = alpaka::atomicCas(acc, address, old,
val)) == old)
35 #endif // __CUDA_ARCH__ or __HIP_DEVICE_COMPILE__ 38 #endif // HeterogeneousCore_AlpakaCore_interface_atomicMaxPair_h
T1 atomicCAS(T1 *address, T1 compare, T2 val)
ret
prodAgent to be discontinued
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE void atomicMaxPair(const TAcc &acc, unsigned long long int *address, std::pair< unsigned int, float > value, F comparator)
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)