Celeritas 0.6.0-dev.116+3fbab5e0
Loading...
Searching...
No Matches
Macros | Functions
Atomics.hh File Reference

Atomics for use in kernel code (CUDA/HIP/OpenMP). More...

#include "corecel/Assert.hh"
#include "corecel/Macros.hh"
#include "corecel/Types.hh"
#include "Algorithms.hh"
This graph shows which files directly or indirectly include this file:

Macros

#define CELER_CAPTURE_IF_OPENMP_TRACK
 Simply scope the next block.
 

Functions

template<class T >
CELER_FORCEINLINE_FUNCTION T celeritas::atomic_add (T *address, T value)
 Add to a value, returning the original value.
 
template<class T >
CELER_FORCEINLINE_FUNCTION T celeritas::atomic_min (T *address, T value)
 Set the value to the minimum of the actual and given, returning old.
 
template<class T >
CELER_FORCEINLINE_FUNCTION T celeritas::atomic_max (T *address, T value)
 Set the value to the maximum of the actual and given, returning old.
 

Detailed Description

Atomics for use in kernel code (CUDA/HIP/OpenMP).

Note
On CPU, these functions assume the atomic add is being done in with track-level parallelism rather than event-level because these utilities are meant for "kernel" code. Multiple independent events must not use these functions to simultaneously modify shared data.