1 #ifndef HeterogeneousCore_AlpakaCore_interface_atomicMaxF_h 2 #define HeterogeneousCore_AlpakaCore_interface_atomicMaxF_h 3 #include <alpaka/alpaka.hpp> 8 #if defined(__CUDA_ARCH__) or defined(__HIP_DEVICE_COMPILE__) 9 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
11 int ret = __float_as_int(*address);
12 while (
val > __int_as_float(
ret)) {
17 return __int_as_float(
ret);
20 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
21 ALPAKA_FN_ACC ALPAKA_FN_INLINE
static float atomicMaxF(
const TAcc& acc,
float* address,
float val) {
24 while (
val > edm::bit_cast<float>(
ret)) {
26 if ((
ret = alpaka::atomicCas(acc, (
int*)address, old, edm::bit_cast<int>(
val))) == old)
31 #endif // __CUDA_ARCH__ or __HIP_DEVICE_COMPILE__ 33 #endif // HeterogeneousCore_AlpakaCore_interface_atomicMaxF_h
T1 atomicCAS(T1 *address, T1 compare, T2 val)
To bit_cast(const From &src) noexcept
ret
prodAgent to be discontinued
ALPAKA_FN_ACC static ALPAKA_FN_INLINE float atomicMaxF(const TAcc &acc, float *address, float val)