1 #ifndef AMREX_BLOCK_MUTEX_H_
2 #define AMREX_BLOCK_MUTEX_H_
3 #include <AMReX_Config.H>
16 unsigned long long ull;
24 static void init_states (state_t* state,
int N) noexcept;
33 void lock (
int i) noexcept {
38 int blockid = blockIdx.z*blockDim.x*blockDim.y + blockIdx.y*blockDim.x + blockIdx.x;
54 }
while (assumed.
ull != old.
ull);
78 }
while (assumed.
ull != old.
ull);
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_GPU_DEVICE
Definition: AMReX_GpuQualifiers.H:18
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
Definition: AMReX_Amr.cpp:49
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void ignore_unused(const Ts &...)
This shuts up the compiler about unused variables.
Definition: AMReX.H:111
Definition: AMReX_BlockMutex.H:15
int blockid
Definition: AMReX_BlockMutex.H:15
int count
Definition: AMReX_BlockMutex.H:15
Definition: AMReX_BlockMutex.H:12
static constexpr AMREX_GPU_HOST_DEVICE state_t FreeState() noexcept
Definition: AMReX_BlockMutex.H:20
~BlockMutex()
Definition: AMReX_BlockMutex.cpp:34
void operator=(BlockMutex const &)=delete
int m_nstates
Definition: AMReX_BlockMutex.H:84
BlockMutex(int N) noexcept
Definition: AMReX_BlockMutex.cpp:21
state_t * m_state
Definition: AMReX_BlockMutex.H:85
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void unlock(int i) noexcept
Definition: AMReX_BlockMutex.H:59
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void lock(int i) noexcept
Definition: AMReX_BlockMutex.H:33
static void init_states(state_t *state, int N) noexcept
Definition: AMReX_BlockMutex.cpp:7
Definition: AMReX_BlockMutex.H:14
struct amrex::BlockMutex::state_t::II data
unsigned long long ull
Definition: AMReX_BlockMutex.H:16