Go to the documentation of this file.
11 #define YAKL_MANAGED_MEMORY
15 #ifndef YAKL_AUTO_FENCE
16 #define YAKL_AUTO_FENCE
20 #ifdef YAKL_AUTO_PROFILE
26 #ifdef YAKL_VERBOSE_FILE
32 #if defined(YAKL_AUTO_PROFILE) || defined(YAKL_VERBOSE)
33 #define YAKL_AUTO_LABEL() (std::string(basename(__FILE__)) + std::string(":") + std::to_string(__LINE__)).c_str()
38 #define YAKL_AUTO_LABEL() ""
45 #define YAKL_LAMBDA [=] __host__ __device__
46 #define YAKL_DEVICE_LAMBDA [=] __device__
47 #define YAKL_CLASS_LAMBDA [=, *this] __host__ __device__
48 #define YAKL_INLINE __host__ __device__ __forceinline__
49 #define YAKL_DEVICE_INLINE __forceinline__ __device__
50 #define YAKL_SCOPE(a,b) auto &a = b
51 #ifndef YAKL_SINGLE_MEMORY_SPACE
52 #define YAKL_SEPARATE_MEMORY_SPACE
54 #if defined(__NVCOMPILER_CUDA__)
55 #define YAKL_EXECUTE_ON_HOST_ONLY(...) NV_IF_TARGET(NV_IS_HOST, __VA_ARGS__)
56 #define YAKL_EXECUTE_ON_DEVICE_ONLY(...) NV_IF_TARGET(NV_IS_DEVICE, __VA_ARGS__)
59 #define YAKL_EXECUTE_ON_HOST_ONLY(...)
60 #define YAKL_EXECUTE_ON_DEVICE_ONLY(...) __VA_ARGS__
62 #define YAKL_EXECUTE_ON_HOST_ONLY(...) __VA_ARGS__
63 #define YAKL_EXECUTE_ON_DEVICE_ONLY(...)
68 #elif defined(YAKL_ARCH_HIP)
71 #define YAKL_LAMBDA [=] __host__ __device__
72 #define YAKL_DEVICE_LAMBDA [=] __device__
73 #define YAKL_CLASS_LAMBDA [=, *this] __host__ __device__
74 #define YAKL_INLINE __host__ __device__ __forceinline__
75 #define YAKL_DEVICE_INLINE __forceinline__ __device__
76 #define YAKL_SCOPE(a,b) auto &a = std::ref(b).get()
77 #ifndef YAKL_SINGLE_MEMORY_SPACE
78 #define YAKL_SEPARATE_MEMORY_SPACE
80 #ifdef __HIP_DEVICE_COMPILE__
81 #define YAKL_EXECUTE_ON_HOST_ONLY(...)
82 #define YAKL_EXECUTE_ON_DEVICE_ONLY(...) __VA_ARGS__
84 #define YAKL_EXECUTE_ON_HOST_ONLY(...) __VA_ARGS__
85 #define YAKL_EXECUTE_ON_DEVICE_ONLY(...)
89 #elif defined(YAKL_ARCH_SYCL)
92 #define YAKL_LAMBDA [=]
93 #define YAKL_DEVICE_LAMBDA [=]
94 #define YAKL_CLASS_LAMBDA [=, *this]
95 #define YAKL_INLINE __inline__ __attribute__((always_inline))
96 #define YAKL_DEVICE_INLINE __inline__ __attribute__((always_inline))
97 #define YAKL_SCOPE(a,b) auto &a = std::ref(b).get()
98 #ifndef YAKL_SINGLE_MEMORY_SPACE
99 #define YAKL_SEPARATE_MEMORY_SPACE
101 #ifdef __SYCL_DEVICE_ONLY__
102 #define YAKL_EXECUTE_ON_HOST_ONLY(...)
103 #define YAKL_EXECUTE_ON_DEVICE_ONLY(...) __VA_ARGS__
104 #define CL_CONSTANT __attribute__((opencl_constant))
106 #define YAKL_EXECUTE_ON_HOST_ONLY(...) __VA_ARGS__
107 #define YAKL_EXECUTE_ON_DEVICE_ONLY(...)
112 #elif defined(YAKL_ARCH_OPENMP)
115 #define YAKL_LAMBDA [=]
116 #define YAKL_DEVICE_LAMBDA [=]
117 #define YAKL_CLASS_LAMBDA [=, *this]
118 #define YAKL_INLINE inline
119 #define YAKL_DEVICE_INLINE inline
120 #define YAKL_SCOPE(a,b) auto &a = b
121 #define YAKL_EXECUTE_ON_HOST_ONLY(...) __VA_ARGS__
122 #define YAKL_EXECUTE_ON_DEVICE_ONLY(...) __VA_ARGS__
128 #define YAKL_LAMBDA [=]
132 #define YAKL_DEVICE_LAMBDA [=]
136 #define YAKL_CLASS_LAMBDA [=, *this]
140 #define YAKL_INLINE inline
144 #define YAKL_DEVICE_INLINE inline
148 #define YAKL_SCOPE(a,b) auto &a = b
153 #define YAKL_EXECUTE_ON_HOST_ONLY(...) __VA_ARGS__
158 #define YAKL_EXECUTE_ON_DEVICE_ONLY(...) __VA_ARGS__