13 #ifdef __SYCL_DEVICE_ONLY__
15 #include <type_traits>
19 inline namespace _V1 {
55 "space is deprecated since SYCL 2020") =
67 "is deprecated since SYCL 2020") = 2
87 inline constexpr mode_target_tag_t<access_mode::read, target::constant_buffer>
89 inline constexpr mode_target_tag_t<access_mode::read, target::host_task>
119 #ifdef __SYCL_DEVICE_ONLY__
120 #define __OPENCL_GLOBAL_AS__ __attribute__((opencl_global))
121 #ifdef __ENABLE_USM_ADDR_SPACE__
122 #define __OPENCL_GLOBAL_DEVICE_AS__ __attribute__((opencl_global_device))
123 #define __OPENCL_GLOBAL_HOST_AS__ __attribute__((opencl_global_host))
125 #define __OPENCL_GLOBAL_DEVICE_AS__ __attribute__((opencl_global))
126 #define __OPENCL_GLOBAL_HOST_AS__ __attribute__((opencl_global))
128 #define __OPENCL_LOCAL_AS__ __attribute__((opencl_local))
129 #define __OPENCL_CONSTANT_AS__ __attribute__((opencl_constant))
130 #define __OPENCL_PRIVATE_AS__ __attribute__((opencl_private))
132 #define __OPENCL_GLOBAL_AS__
133 #define __OPENCL_GLOBAL_DEVICE_AS__
134 #define __OPENCL_GLOBAL_HOST_AS__
135 #define __OPENCL_LOCAL_AS__
136 #define __OPENCL_CONSTANT_AS__
137 #define __OPENCL_PRIVATE_AS__
145 #ifdef __ENABLE_USM_ADDR_SPACE__
146 template <>
struct TargetToAS<access::target::device> {
157 template <>
struct TargetToAS<access::target::constant_buffer> {
159 access::address_space::constant_space;
162 template <
typename ElementType, access::address_space addressSpace>
165 template <
typename ElementType>
170 template <
typename ElementType>
175 template <
typename ElementType>
180 template <
typename ElementType>
182 access::address_space::ext_intel_global_device_space> {
186 template <
typename ElementType>
188 access::address_space::ext_intel_global_host_space> {
192 template <
typename ElementType>
199 #if defined(RESTRICT_WRITE_ACCESS_TO_CONSTANT_PTR)
206 template <
typename ElementType>
211 #ifdef __SYCL_DEVICE_ONLY__
212 template <
class T>
struct deduce_AS_impl {
220 #ifdef __ENABLE_USM_ADDR_SPACE__
249 access::address_space::constant_space;
255 std::remove_pointer_t<std::remove_reference_t<std::remove_cv_t<T>>>> {
263 #ifdef __SYCL_DEVICE_ONLY__
268 #ifdef __ENABLE_USM_ADDR_SPACE__
269 template <
typename T>
274 template <
typename T>
324 template <
typename T>
330 template <
typename ToT,
typename FromT>
inline ToT
cast_AS(FromT from) {
331 #ifdef __SYCL_DEVICE_ONLY__
335 #if defined(__NVPTX__) || defined(__AMDGCN__) || defined(__SYCL_NATIVE_CPU__)
342 using ToElemT = std::remove_pointer_t<remove_decoration_t<ToT>>;
344 return __SYCL_GenericCastToPtrExplicit_ToGlobal<ToElemT>(from);
346 return __SYCL_GenericCastToPtrExplicit_ToLocal<ToElemT>(from);
348 return __SYCL_GenericCastToPtrExplicit_ToPrivate<ToElemT>(from);
349 #ifdef __ENABLE_USM_ADDR_SPACE__
351 ext_intel_global_device_space ||
360 return reinterpret_cast<ToT
>(from);
363 #ifdef __ENABLE_USM_ADDR_SPACE__
376 return reinterpret_cast<ToT
>(from);
382 #undef __OPENCL_GLOBAL_AS__
383 #undef __OPENCL_GLOBAL_DEVICE_AS__
384 #undef __OPENCL_GLOBAL_HOST_AS__
385 #undef __OPENCL_LOCAL_AS__
386 #undef __OPENCL_CONSTANT_AS__
387 #undef __OPENCL_PRIVATE_AS__
#define __OPENCL_PRIVATE_AS__
#define __OPENCL_GLOBAL_DEVICE_AS__
#define __OPENCL_LOCAL_AS__
#define __OPENCL_CONSTANT_AS__
#define __OPENCL_GLOBAL_AS__
#define __OPENCL_GLOBAL_HOST_AS__
The SYCL device class encapsulates a single SYCL device on which kernels may be executed.
Defines a shared image data.
@ ext_intel_global_host_space
@ ext_intel_global_device_space
constexpr bool isTargetHostAccess(access::target T)
constexpr bool modeNeedsOldData(access::mode m)
constexpr bool modeWritesNewData(access::mode m)
constexpr mode_tag_t< access_mode::read > read_only
constexpr mode_tag_t< access_mode::read_write > read_write
constexpr mode_target_tag_t< access_mode::read, target::host_task > read_only_host_task
constexpr mode_target_tag_t< access_mode::read_write, target::host_task > read_write_host_task
constexpr mode_target_tag_t< access_mode::read, target::constant_buffer > read_constant
constexpr mode_target_tag_t< access_mode::write, target::host_task > write_only_host_task
typename remove_decoration< T >::type remove_decoration_t
constexpr mode_tag_t< access_mode::write > write_only
__OPENCL_GLOBAL_AS__ ElementType type
__OPENCL_GLOBAL_DEVICE_AS__ ElementType type
__OPENCL_GLOBAL_HOST_AS__ ElementType type
__OPENCL_GLOBAL_AS__ ElementType type
__OPENCL_LOCAL_AS__ ElementType type
__OPENCL_PRIVATE_AS__ ElementType type
constexpr static access::address_space AS
mode_target_tag_t()=default
typename remove_decoration< T >::type * type
typename remove_decoration< T >::type & type
const typename remove_decoration< T >::type type
const typename remove_decoration< T >::type * type
const typename remove_decoration< T >::type & type
typename detail::remove_decoration_impl< T >::type type