RAJA
RAJA provides a collection of platform portability abstractions for C++ HPC applications.
Classes | Namespaces | Macros | Functions
atomic_auto.hpp File Reference

RAJA header file defining automatic and builtin atomic operations. More...

#include "RAJA/config.hpp"
#include "RAJA/util/macros.hpp"
#include "RAJA/policy/sequential/atomic.hpp"

Go to the source code of this file.

Classes

struct  RAJA::auto_atomic
 Atomic policy that automatically does "the right thing". More...
 

Namespaces

 RAJA
 

Macros

#define RAJA_AUTO_ATOMIC    RAJA::seq_atomic {}
 

Functions

template<typename T >
RAJA_INLINE RAJA_HOST_DEVICERAJA::atomicLoad (auto_atomic, T *acc)
 
template<typename T >
RAJA_INLINE RAJA_HOST_DEVICE void RAJA::atomicStore (auto_atomic, T *acc, T value)
 
template<typename T >
RAJA_INLINE RAJA_HOST_DEVICERAJA::atomicAdd (auto_atomic, T *acc, T value)
 
template<typename T >
RAJA_INLINE RAJA_HOST_DEVICERAJA::atomicSub (auto_atomic, T *acc, T value)
 
template<typename T >
RAJA_INLINE RAJA_HOST_DEVICERAJA::atomicMin (auto_atomic, T *acc, T value)
 
template<typename T >
RAJA_INLINE RAJA_HOST_DEVICERAJA::atomicMax (auto_atomic, T *acc, T value)
 
template<typename T >
RAJA_INLINE RAJA_HOST_DEVICERAJA::atomicInc (auto_atomic, T *acc)
 
template<typename T >
RAJA_INLINE RAJA_HOST_DEVICERAJA::atomicInc (auto_atomic, T *acc, T compare)
 
template<typename T >
RAJA_INLINE RAJA_HOST_DEVICERAJA::atomicDec (auto_atomic, T *acc)
 
template<typename T >
RAJA_INLINE RAJA_HOST_DEVICERAJA::atomicDec (auto_atomic, T *acc, T compare)
 
template<typename T >
RAJA_INLINE RAJA_HOST_DEVICERAJA::atomicAnd (auto_atomic, T *acc, T value)
 
template<typename T >
RAJA_INLINE RAJA_HOST_DEVICERAJA::atomicOr (auto_atomic, T *acc, T value)
 
template<typename T >
RAJA_INLINE RAJA_HOST_DEVICERAJA::atomicXor (auto_atomic, T *acc, T value)
 
template<typename T >
RAJA_INLINE RAJA_HOST_DEVICERAJA::atomicExchange (auto_atomic, T *acc, T value)
 
template<typename T >
RAJA_INLINE RAJA_HOST_DEVICERAJA::atomicCAS (auto_atomic, T *acc, T compare, T value)
 

Detailed Description

RAJA header file defining automatic and builtin atomic operations.

Macro Definition Documentation

◆ RAJA_AUTO_ATOMIC

#define RAJA_AUTO_ATOMIC    RAJA::seq_atomic {}

Provides priority between atomic policies that should do the "right thing"

If we are in a CUDA device function, then it always uses the cuda_atomic policy.

Next, if OpenMP is enabled we always use the omp_atomic, which should generally work everywhere.

Finally, we fallback on the seq_atomic, which performs non-atomic operations because we assume there is no thread safety issues (no parallel model)