20 #ifndef RAJA_INTERNAL_MACROS_HPP
21 #define RAJA_INTERNAL_MACROS_HPP
23 #include "RAJA/config.hpp"
29 #if defined(RAJA_HIP_ACTIVE)
30 #include <hip/hip_runtime.h>
38 #if (defined(RAJA_ENABLE_CUDA) && defined(__CUDA_ARCH__)) || \
39 (defined(RAJA_ENABLE_HIP) && defined(__HIP_DEVICE_COMPILE__)) || \
40 (defined(RAJA_ENABLE_SYCL) && defined(__SYCL_DEVICE_ONLY__))
41 #define RAJA_GPU_DEVICE_COMPILE_PASS_ACTIVE
44 #if defined(RAJA_ENABLE_CUDA) && defined(__CUDACC__)
45 #define RAJA_HOST_DEVICE __host__ __device__
46 #define RAJA_DEVICE __device__
47 #define RAJA_HOST __host__
49 #if defined(RAJA_ENABLE_CLANG_CUDA)
50 #define RAJA_SUPPRESS_HD_WARN
52 #define RAJA_SUPPRESS_HD_WARN RAJA_PRAGMA(nv_exec_check_disable)
55 #elif defined(RAJA_ENABLE_HIP) && defined(__HIPCC__)
56 #define RAJA_HOST_DEVICE __host__ __device__
57 #define RAJA_DEVICE __device__
58 #define RAJA_HOST __host__
59 #define RAJA_SUPPRESS_HD_WARN
61 #define RAJA_USE_HIP_INTRINSICS
65 #define RAJA_HOST_DEVICE
68 #define RAJA_SUPPRESS_HD_WARN
72 #if defined(__has_builtin)
73 #define RAJA_INTERNAL_CLANG_HAS_BUILTIN(x) __has_builtin(x)
75 #define RAJA_INTERNAL_CLANG_HAS_BUILTIN(x) 0
97 #define RAJA_UNUSED_ARG(x)
119 template<
typename... T>
122 #define RAJA_DIVIDE_CEILING_INT(dividend, divisor) \
123 (((dividend) + (divisor) - 1) / (divisor))
129 #if defined(RAJA_ENABLE_OPENMP)
130 #define RAJA_OMP_DECLARE_REDUCTION_COMBINE \
131 RAJA_UNUSED_VAR(EXEC_POL {}); \
132 _Pragma(" omp declare reduction( combine \
133 : typename std::remove_reference<decltype(f_params)>::type \
134 : RAJA::expt::ParamMultiplexer::parampack_combine(EXEC_POL{}, omp_out, omp_in) ) ")
136 #define RAJA_OMP_DECLARE_TUPLE_REDUCTION_COMBINE \
137 _Pragma(" omp declare reduction( combine \
138 : typename std::remove_reference<decltype(reducers_tuple)>::type \
139 : RAJA::expt::detail::combine_params<EXEC_POL>(omp_out, omp_in) ) ")
145 #if defined(__SYCL_DEVICE_ONLY__)
148 *((
volatile char*)0) = 0;
151 #if defined(RAJA_ENABLE_TARGET_OPENMP) && (_OPENMP >= 201511)
153 *((
volatile char*)0) = 0;
154 #elif defined(__CUDA_ARCH__)
157 #elif defined(__HIP_DEVICE_COMPILE__)
161 #ifdef RAJA_COMPILER_MSVC
165 bool no_except =
false;
166 if (_dupenv_s(&value, &len,
"RAJA_NO_EXCEPT") == 0 && value !=
nullptr)
173 bool no_except = std::getenv(
"RAJA_NO_EXCEPT") !=
nullptr;
183 throw std::runtime_error(str);
199 #if (__cplusplus >= 201402L)
200 #define RAJA_HAS_CXX14 1
201 #define RAJA_HAS_CXX_ATTRIBUTE_DEPRECATED 1
202 #elif defined(__has_cpp_attribute)
203 #if __has_cpp_attribute(deprecated)
204 #define RAJA_HAS_CXX_ATTRIBUTE_DEPRECATED 1
208 #if defined(RAJA_HAS_CXX_ATTRIBUTE_DEPRECATED)
210 #define RAJA_DEPRECATE(Msg) [[deprecated(Msg)]]
211 #define RAJA_DEPRECATE_ALIAS(Msg) [[deprecated(Msg)]]
213 #elif defined(_MSC_VER)
216 #define RAJA_DEPRECATE(Msg) __declspec(deprecated(Msg))
217 #define RAJA_DEPRECATE_ALIAS(Msg)
222 #define RAJA_DEPRECATE(Msg) __attribute__((deprecated(Msg)))
223 #define RAJA_DEPRECATE_ALIAS(Msg)
RAJA_HOST_DEVICE RAJA_INLINE void RAJA_UNUSED_VAR(T &&...) noexcept
Definition: macros.hpp:120
RAJA_HOST_DEVICE void RAJA_ABORT_OR_THROW(const char *str)
Definition: macros.hpp:143
#define RAJA_HOST_DEVICE
Definition: macros.hpp:65