Go to the source code of this file.
|
template<typename TAcc , typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>, typename F > |
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) |
|
◆ atomicMaxPair()
template<typename TAcc , typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>, typename F >
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 |
|
) |
| |
Definition at line 10 of file atomicMaxPair.h.
References cms::cudacompat::atomicCAS(), runTheMatrix::ret, and heppy_batch::val.
Referenced by ALPAKA_ACCELERATOR_NAMESPACE::hcal::reconstruction::mahi::Kernel_prep1d_sameNumberOfSamples::operator()().
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__ T1 atomicCAS(T1 *address, T1 compare, T2 val)
ret
prodAgent to be discontinued