Block-Structured AMR Software Framework
amrex::Gpu::Atomic Namespace Reference

Namespaces

 detail
 

Functions

template<class T >
AMREX_GPU_DEVICE AMREX_FORCE_INLINEAdd_device (T *const sum, T const value) noexcept
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE Long Add_device (Long *const sum, Long const value) noexcept
 
template<class T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINEAdd (T *sum, T value) noexcept
 
template<typename T , typename Op , typename Cond , std::enable_if_t< sizeof(T)==sizeof(unsigned int), int > foo = 0>
AMREX_GPU_DEVICE AMREX_FORCE_INLINE bool If_device (T *const sum, T const value, Op &&op, Cond &&cond) noexcept
 
template<class T , class Op , class Cond >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool If (T *const add, T const value, Op &&op, Cond &&cond) noexcept
 Conditionally perform an atomic operation. More...
 
template<class T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void AddNoRet (T *sum, T value) noexcept
 
template<class T >
AMREX_GPU_DEVICE AMREX_FORCE_INLINEMin_device (T *const m, T const value) noexcept
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE float Min_device (float *const m, float const value) noexcept
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE double Min_device (double *const m, double const value) noexcept
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE Long Min_device (Long *const m, Long const value) noexcept
 
template<class T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINEMin (T *const m, T const value) noexcept
 
template<class T >
AMREX_GPU_DEVICE AMREX_FORCE_INLINEMax_device (T *const m, T const value) noexcept
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE float Max_device (float *const m, float const value) noexcept
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE double Max_device (double *const m, double const value) noexcept
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE Long Max_device (Long *const m, Long const value) noexcept
 
template<class T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINEMax (T *const m, T const value) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int LogicalOr (int *const m, int const value) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int LogicalAnd (int *const m, int const value) noexcept
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINEExch (T *address, T val) noexcept
 
template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINECAS (T *const address, T compare, T const val) noexcept
 
template<typename T , std::enable_if_t< sizeof(T)==sizeof(int), int > = 0>
AMREX_GPU_DEVICE AMREX_FORCE_INLINEMultiply_device (T *const prod, T const value) noexcept
 
template<class T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINEMultiply (T *const prod, T const value) noexcept
 
template<typename T , std::enable_if_t< sizeof(T)==sizeof(int), int > = 0>
AMREX_GPU_DEVICE AMREX_FORCE_INLINEDivide_device (T *const quot, T const value) noexcept
 
template<class T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINEDivide (T *const quot, T const value) noexcept
 

Function Documentation

◆ Add()

template<class T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T amrex::Gpu::Atomic::Add ( T *  sum,
value 
)
noexcept

◆ Add_device() [1/2]

AMREX_GPU_DEVICE AMREX_FORCE_INLINE Long amrex::Gpu::Atomic::Add_device ( Long *const  sum,
Long const  value 
)
noexcept

◆ Add_device() [2/2]

template<class T >
AMREX_GPU_DEVICE AMREX_FORCE_INLINE T amrex::Gpu::Atomic::Add_device ( T *const  sum,
T const  value 
)
noexcept

◆ AddNoRet()

template<class T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void amrex::Gpu::Atomic::AddNoRet ( T *  sum,
value 
)
noexcept

◆ CAS()

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T amrex::Gpu::Atomic::CAS ( T *const  address,
compare,
T const  val 
)
noexcept

◆ Divide()

template<class T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T amrex::Gpu::Atomic::Divide ( T *const  quot,
T const  value 
)
noexcept

◆ Divide_device()

template<typename T , std::enable_if_t< sizeof(T)==sizeof(int), int > = 0>
AMREX_GPU_DEVICE AMREX_FORCE_INLINE T amrex::Gpu::Atomic::Divide_device ( T *const  quot,
T const  value 
)
noexcept

◆ Exch()

template<typename T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T amrex::Gpu::Atomic::Exch ( T *  address,
val 
)
noexcept

◆ If()

template<class T , class Op , class Cond >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool amrex::Gpu::Atomic::If ( T *const  add,
T const  value,
Op &&  op,
Cond &&  cond 
)
noexcept

Conditionally perform an atomic operation.

Atomically updates the result at "add" with "value" using "op", but only if "cond" is true.

Template Parameters
Tthe type pointed to by add
Opcallable that takes two T argument and combines them
Condcallable that takes a "T" a returns whether to do the update
Parameters
addaddress to atomically update
valuevalue to combine
opcallable specifying the operation to use to combine *add and value
condcallable specifying the condition to test on first. The value passed in to the cond function is the would-be combined value

◆ If_device()

template<typename T , typename Op , typename Cond , std::enable_if_t< sizeof(T)==sizeof(unsigned int), int > foo = 0>
AMREX_GPU_DEVICE AMREX_FORCE_INLINE bool amrex::Gpu::Atomic::If_device ( T *const  sum,
T const  value,
Op &&  op,
Cond &&  cond 
)
noexcept

◆ LogicalAnd()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int amrex::Gpu::Atomic::LogicalAnd ( int *const  m,
int const  value 
)
noexcept

◆ LogicalOr()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int amrex::Gpu::Atomic::LogicalOr ( int *const  m,
int const  value 
)
noexcept

◆ Max()

template<class T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T amrex::Gpu::Atomic::Max ( T *const  m,
T const  value 
)
noexcept

◆ Max_device() [1/4]

AMREX_GPU_DEVICE AMREX_FORCE_INLINE double amrex::Gpu::Atomic::Max_device ( double *const  m,
double const  value 
)
noexcept

◆ Max_device() [2/4]

AMREX_GPU_DEVICE AMREX_FORCE_INLINE float amrex::Gpu::Atomic::Max_device ( float *const  m,
float const  value 
)
noexcept

◆ Max_device() [3/4]

AMREX_GPU_DEVICE AMREX_FORCE_INLINE Long amrex::Gpu::Atomic::Max_device ( Long *const  m,
Long const  value 
)
noexcept

◆ Max_device() [4/4]

template<class T >
AMREX_GPU_DEVICE AMREX_FORCE_INLINE T amrex::Gpu::Atomic::Max_device ( T *const  m,
T const  value 
)
noexcept

◆ Min()

template<class T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T amrex::Gpu::Atomic::Min ( T *const  m,
T const  value 
)
noexcept

◆ Min_device() [1/4]

AMREX_GPU_DEVICE AMREX_FORCE_INLINE double amrex::Gpu::Atomic::Min_device ( double *const  m,
double const  value 
)
noexcept

◆ Min_device() [2/4]

AMREX_GPU_DEVICE AMREX_FORCE_INLINE float amrex::Gpu::Atomic::Min_device ( float *const  m,
float const  value 
)
noexcept

◆ Min_device() [3/4]

AMREX_GPU_DEVICE AMREX_FORCE_INLINE Long amrex::Gpu::Atomic::Min_device ( Long *const  m,
Long const  value 
)
noexcept

◆ Min_device() [4/4]

template<class T >
AMREX_GPU_DEVICE AMREX_FORCE_INLINE T amrex::Gpu::Atomic::Min_device ( T *const  m,
T const  value 
)
noexcept

◆ Multiply()

template<class T >
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T amrex::Gpu::Atomic::Multiply ( T *const  prod,
T const  value 
)
noexcept

◆ Multiply_device()

template<typename T , std::enable_if_t< sizeof(T)==sizeof(int), int > = 0>
AMREX_GPU_DEVICE AMREX_FORCE_INLINE T amrex::Gpu::Atomic::Multiply_device ( T *const  prod,
T const  value 
)
noexcept