Block-Structured AMR Software Framework
AMReX_GpuQualifiers.H File Reference
#include <AMReX_Config.H>

Go to the source code of this file.

Macros

#define AMREX_GPU_HOST   __host__
 
#define AMREX_GPU_DEVICE   __device__
 
#define AMREX_GPU_GLOBAL   __global__
 
#define AMREX_GPU_HOST_DEVICE   __host__ __device__
 
#define AMREX_GPU_CONSTANT   __constant__
 
#define AMREX_GPU_MANAGED   __managed__
 
#define AMREX_GPU_DEVICE_MANAGED   __device__ __managed__
 
#define AMREX_DEVICE_COMPILE   (__CUDA_ARCH__ || __HIP_DEVICE_COMPILE__ || __SYCL_DEVICE_ONLY__)
 
#define AMREX_IMPL_STRIP_PARENS(X)   AMREX_IMPL_ESC(AMREX_IMPL_ISH X)
 
#define AMREX_IMPL_ISH(...)   AMREX_IMPL_ISH __VA_ARGS__
 
#define AMREX_IMPL_ESC(...)   AMREX_IMPL_ESC_(__VA_ARGS__)
 
#define AMREX_IMPL_ESC_(...)   AMREX_IMPL_VAN_##__VA_ARGS__
 
#define AMREX_IMPL_VAN_AMREX_IMPL_ISH
 
#define AMREX_IF_ON_DEVICE(CODE)    {}
 
#define AMREX_IF_ON_HOST(CODE)    { AMREX_IMPL_STRIP_PARENS(CODE) }
 
#define AMREX_WRONG_NUM_ARGS(...)   static_assert(false,"Wrong number of arguments to macro")
 
#define AMREX_GET_DGV_MACRO(_1, _2, _3, NAME, ...)   NAME
 
#define AMREX_DEVICE_GLOBAL_VARIABLE(...)
 
#define AMREX_DGV(type, name)   __device__ type name
 
#define AMREX_DGVARR(type, num, name)   __device__ type name[num]
 

Macro Definition Documentation

◆ AMREX_DEVICE_COMPILE

#define AMREX_DEVICE_COMPILE   (__CUDA_ARCH__ || __HIP_DEVICE_COMPILE__ || __SYCL_DEVICE_ONLY__)

◆ AMREX_DEVICE_GLOBAL_VARIABLE

#define AMREX_DEVICE_GLOBAL_VARIABLE (   ...)
Value:
AMREX_GET_DGV_MACRO(__VA_ARGS__,\
AMREX_WRONG_NUM_ARGS)(__VA_ARGS__)
#define AMREX_WRONG_NUM_ARGS(...)
Definition: AMReX_GpuQualifiers.H:67
#define AMREX_GET_DGV_MACRO(_1, _2, _3, NAME,...)
Definition: AMReX_GpuQualifiers.H:69
#define AMREX_DGV(type, name)
Definition: AMReX_GpuQualifiers.H:78
#define AMREX_DGVARR(type, num, name)
Definition: AMReX_GpuQualifiers.H:79

◆ AMREX_DGV

#define AMREX_DGV (   type,
  name 
)    __device__ type name

◆ AMREX_DGVARR

#define AMREX_DGVARR (   type,
  num,
  name 
)    __device__ type name[num]

◆ AMREX_GET_DGV_MACRO

#define AMREX_GET_DGV_MACRO (   _1,
  _2,
  _3,
  NAME,
  ... 
)    NAME

◆ AMREX_GPU_CONSTANT

#define AMREX_GPU_CONSTANT   __constant__

◆ AMREX_GPU_DEVICE

#define AMREX_GPU_DEVICE   __device__

◆ AMREX_GPU_DEVICE_MANAGED

#define AMREX_GPU_DEVICE_MANAGED   __device__ __managed__

◆ AMREX_GPU_GLOBAL

#define AMREX_GPU_GLOBAL   __global__

◆ AMREX_GPU_HOST

#define AMREX_GPU_HOST   __host__

◆ AMREX_GPU_HOST_DEVICE

#define AMREX_GPU_HOST_DEVICE   __host__ __device__

◆ AMREX_GPU_MANAGED

#define AMREX_GPU_MANAGED   __managed__

◆ AMREX_IF_ON_DEVICE

#define AMREX_IF_ON_DEVICE (   CODE)     {}

◆ AMREX_IF_ON_HOST

#define AMREX_IF_ON_HOST (   CODE)     { AMREX_IMPL_STRIP_PARENS(CODE) }

◆ AMREX_IMPL_ESC

#define AMREX_IMPL_ESC (   ...)    AMREX_IMPL_ESC_(__VA_ARGS__)

◆ AMREX_IMPL_ESC_

#define AMREX_IMPL_ESC_ (   ...)    AMREX_IMPL_VAN_##__VA_ARGS__

◆ AMREX_IMPL_ISH

#define AMREX_IMPL_ISH (   ...)    AMREX_IMPL_ISH __VA_ARGS__

◆ AMREX_IMPL_STRIP_PARENS

#define AMREX_IMPL_STRIP_PARENS (   X)    AMREX_IMPL_ESC(AMREX_IMPL_ISH X)

◆ AMREX_IMPL_VAN_AMREX_IMPL_ISH

#define AMREX_IMPL_VAN_AMREX_IMPL_ISH

◆ AMREX_WRONG_NUM_ARGS

#define AMREX_WRONG_NUM_ARGS (   ...)    static_assert(false,"Wrong number of arguments to macro")