50 "space is deprecated since SYCL 2020") =
75 inline constexpr mode_target_tag_t<access_mode::read, target::constant_buffer>
81 return T == access::target::host_buffer || T == access::target::host_image;
90 return m != access::mode::read;
101 #ifdef __SYCL_DEVICE_ONLY__
102 #define __OPENCL_GLOBAL_AS__ __attribute__((opencl_global))
103 #ifdef __ENABLE_USM_ADDR_SPACE__
104 #define __OPENCL_GLOBAL_DEVICE_AS__ __attribute__((opencl_global_device))
105 #define __OPENCL_GLOBAL_HOST_AS__ __attribute__((opencl_global_host))
107 #define __OPENCL_GLOBAL_DEVICE_AS__ __attribute__((opencl_global))
108 #define __OPENCL_GLOBAL_HOST_AS__ __attribute__((opencl_global))
110 #define __OPENCL_LOCAL_AS__ __attribute__((opencl_local))
111 #define __OPENCL_CONSTANT_AS__ __attribute__((opencl_constant))
112 #define __OPENCL_PRIVATE_AS__ __attribute__((opencl_private))
114 #define __OPENCL_GLOBAL_AS__
115 #define __OPENCL_GLOBAL_DEVICE_AS__
116 #define __OPENCL_GLOBAL_HOST_AS__
117 #define __OPENCL_LOCAL_AS__
118 #define __OPENCL_CONSTANT_AS__
119 #define __OPENCL_PRIVATE_AS__
124 access::address_space::global_space;
127 #ifdef __ENABLE_USM_ADDR_SPACE__
128 template <>
struct TargetToAS<access::target::device> {
130 access::address_space::ext_intel_global_device_space;
136 access::address_space::local_space;
139 template <>
struct TargetToAS<access::target::constant_buffer> {
141 access::address_space::constant_space;
144 template <
typename ElementType, access::address_space addressSpace>
147 template <
typename ElementType>
152 template <
typename ElementType>
157 template <
typename ElementType>
162 template <
typename ElementType>
164 access::address_space::ext_intel_global_device_space> {
168 template <
typename ElementType>
170 access::address_space::ext_intel_global_host_space> {
174 template <
typename ElementType>
181 #if defined(RESTRICT_WRITE_ACCESS_TO_CONSTANT_PTR)
188 template <
typename ElementType>
193 #ifdef __SYCL_DEVICE_ONLY__
194 template <
class T>
struct deduce_AS_impl {
199 access::address_space::generic_space;
202 #ifdef __ENABLE_USM_ADDR_SPACE__
205 access::address_space::ext_intel_global_device_space;
210 access::address_space::ext_intel_global_host_space;
216 access::address_space::global_space;
221 access::address_space::private_space;
226 access::address_space::local_space;
231 access::address_space::constant_space;
237 std::remove_pointer_t<std::remove_reference_t<std::remove_cv_t<T>>>> {
272 #ifdef __SYCL_DEVICE_ONLY__
277 #ifdef __ENABLE_USM_ADDR_SPACE__
301 template <
typename T>
307 template <
typename ToT,
typename FromT>
inline ToT
cast_AS(FromT from) {
308 #ifdef __SYCL_DEVICE_ONLY__
311 if constexpr (FromAS == access::address_space::generic_space) {
312 #if defined(__NVPTX__) || defined(__AMDGCN__)
319 using ToElemT = std::remove_pointer_t<remove_decoration_t<ToT>>;
320 if constexpr (ToAS == access::address_space::global_space)
321 return __SYCL_GenericCastToPtrExplicit_ToGlobal<ToElemT>(from);
322 else if constexpr (ToAS == access::address_space::local_space)
323 return __SYCL_GenericCastToPtrExplicit_ToLocal<ToElemT>(from);
324 else if constexpr (ToAS == access::address_space::private_space)
325 return __SYCL_GenericCastToPtrExplicit_ToPrivate<ToElemT>(from);
326 #ifdef __ENABLE_USM_ADDR_SPACE__
328 ext_intel_global_device_space ||
330 access::address_space::ext_intel_global_host_space)
337 return reinterpret_cast<ToT
>(from);
340 #ifdef __ENABLE_USM_ADDR_SPACE__
341 if constexpr (FromAS == access::address_space::global_space &&
343 access::address_space::ext_intel_global_device_space ||
345 access::address_space::ext_intel_global_host_space)) {
353 return reinterpret_cast<ToT
>(from);
359 #undef __OPENCL_GLOBAL_AS__
360 #undef __OPENCL_GLOBAL_DEVICE_AS__
361 #undef __OPENCL_GLOBAL_HOST_AS__
362 #undef __OPENCL_LOCAL_AS__
363 #undef __OPENCL_CONSTANT_AS__
364 #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.
#define __SYCL_INLINE_VER_NAMESPACE(X)
#define __SYCL2020_DEPRECATED(message)
@ 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)
void write(GlobalBufAccessorT &GlobalFlushBuf, size_t FlushBufferSize, unsigned WIOffset, const char *Str, unsigned Len, unsigned Padding=0)
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::constant_buffer > read_constant
typename remove_decoration< T >::type remove_decoration_t
constexpr mode_tag_t< access_mode::write > write_only
---— Error handling, matching OpenCL plugin semantics.
__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
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