37#ifndef EBGEOMETRY_GPU_HPP
38#define EBGEOMETRY_GPU_HPP
47#elif defined(__CUDACC__)
48#define EBGEOMETRY_CUDA
58#if defined(EBGEOMETRY_HOST_TUNED_DEFAULTS) && (defined(EBGEOMETRY_CUDA) || defined(EBGEOMETRY_HIP))
60 "EBGEOMETRY_HOST_TUNED_DEFAULTS is for host-only builds; it must not be defined in a CUDA or HIP translation unit"
66#if defined(EBGEOMETRY_CUDA) || defined(EBGEOMETRY_HIP)
69#define EBGEOMETRY_HOST_DEVICE __host__ __device__
72#define EBGEOMETRY_HOST __host__
75#define EBGEOMETRY_GLOBAL __global__
80#define EBGEOMETRY_HOST_DEVICE
83#define EBGEOMETRY_HOST
86#define EBGEOMETRY_GLOBAL
94#if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__)
95#define EBGEOMETRY_DEVICE_COMPILE
105#if defined(EBGEOMETRY_DEVICE_COMPILE)
107#define EBGEOMETRY_DEVICE_NOINLINE __noinline__
110#define EBGEOMETRY_DEVICE_NOINLINE
118#if !defined(EBGEOMETRY_DEVICE_COMPILE) && (defined(__GNUC__) || defined(__clang__))
120#define EBGEOMETRY_HOST_ALWAYS_INLINE __attribute__((always_inline))
123#define EBGEOMETRY_HOST_ALWAYS_INLINE
130#if !defined(EBGEOMETRY_DEVICE_COMPILE) && (defined(__GNUC__) || defined(__clang__))
132#define EBGEOMETRY_HOST_NOINLINE __attribute__((noinline))
135#define EBGEOMETRY_HOST_NOINLINE
148#if defined(EBGEOMETRY_CUDA) && defined(__CUDACC_VER_MAJOR__) && \
149 (__CUDACC_VER_MAJOR__ > 11 || (__CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ >= 7)) && \
150 !(defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 700)
152#define EBGEOMETRY_GRID_CONSTANT __grid_constant__
155#define EBGEOMETRY_GRID_CONSTANT
177#define EBGEOMETRY_EXEC_CHECK_DISABLE _Pragma("nv_exec_check_disable")
180#define EBGEOMETRY_EXEC_CHECK_DISABLE
184namespace CallableDetail {
200template <
class F,
class... Args>
205 return static_cast<F&&
>(a_f)(
static_cast<Args&&
>(a_args)...);
#define EBGEOMETRY_EXEC_CHECK_DISABLE
Switch off nvcc's host/device call check for the function template that follows (nvcc only).
Definition EBGeometry_GPU.hpp:180
#define EBGEOMETRY_HOST_DEVICE
Mark a function as callable from both host and device code (no-op on host compilers).
Definition EBGeometry_GPU.hpp:80
EBGEOMETRY_EXEC_CHECK_DISABLE decltype(auto) call(F &&a_f, Args &&... a_args)
Call a caller-supplied callable from host-device code.
Definition EBGeometry_GPU.hpp:203
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_Affine.hpp:26