17 inline namespace _V1 {
18 namespace ext::intel {
20 template <
class _name,
class _dataT,
int32_t _min_capacity = 0>
class pipe {
27 static _dataT
read(
bool &_Success) {
28 #ifdef __SYCL_DEVICE_ONLY__
29 __ocl_RPipeTy<_dataT> _RPipe =
30 __spirv_CreatePipeFromPipeStorage_read<_dataT>(&m_Storage);
32 _Success = !
static_cast<bool>(
33 __spirv_ReadPipe(_RPipe, &TempData, m_Size, m_Alignment));
39 "Device-side API are not supported on a host device. Please use "
40 "host-side API instead.");
41 #endif // __SYCL_DEVICE_ONLY__
46 static void write(
const _dataT &_Data,
bool &_Success) {
47 #ifdef __SYCL_DEVICE_ONLY__
48 __ocl_WPipeTy<_dataT> _WPipe =
49 __spirv_CreatePipeFromPipeStorage_write<_dataT>(&m_Storage);
50 _Success = !
static_cast<bool>(
51 __spirv_WritePipe(_WPipe, &_Data, m_Size, m_Alignment));
57 "Device-side API are not supported on a host device. Please use "
58 "host-side API instead.");
59 #endif // __SYCL_DEVICE_ONLY__
66 #ifdef __SYCL_DEVICE_ONLY__
67 __ocl_RPipeTy<_dataT> _RPipe =
68 __spirv_CreatePipeFromPipeStorage_read<_dataT>(&m_Storage);
70 __spirv_ReadPipeBlockingINTEL(_RPipe, &TempData, m_Size, m_Alignment);
75 "Device-side API are not supported on a host device. Please use "
76 "host-side API instead..");
77 #endif // __SYCL_DEVICE_ONLY__
82 static void write(
const _dataT &_Data) {
83 #ifdef __SYCL_DEVICE_ONLY__
84 __ocl_WPipeTy<_dataT> _WPipe =
85 __spirv_CreatePipeFromPipeStorage_write<_dataT>(&m_Storage);
86 __spirv_WritePipeBlockingINTEL(_WPipe, &_Data, m_Size, m_Alignment);
91 "Device-side API are not supported on a host device. Please use "
92 "host-side API instead.");
93 #endif // __SYCL_DEVICE_ONLY__
97 static constexpr int32_t m_Size =
sizeof(_dataT);
98 static constexpr int32_t m_Alignment =
alignof(_dataT);
99 #ifdef __SYCL_DEVICE_ONLY__
100 static constexpr
struct ConstantPipeStorage m_Storage = {m_Size, m_Alignment,
102 #endif // __SYCL_DEVICE_ONLY__
125 template <
class _name,
class _dataT,
size_t _min_capacity = 0>
133 static _dataT
read(
bool &_Success) {
134 #ifdef __SYCL_DEVICE_ONLY__
135 __ocl_RPipeTy<_dataT> _RPipe =
136 __spirv_CreatePipeFromPipeStorage_read<_dataT>(&m_Storage);
138 _Success = !
static_cast<bool>(
139 __spirv_ReadPipe(_RPipe, &TempData, m_Size, m_Alignment));
145 "Device-side API are not supported on a host device. Please use "
146 "host-side API instead.");
147 #endif // __SYCL_DEVICE_ONLY__
154 #ifdef __SYCL_DEVICE_ONLY__
155 __ocl_RPipeTy<_dataT> _RPipe =
156 __spirv_CreatePipeFromPipeStorage_read<_dataT>(&m_Storage);
158 __spirv_ReadPipeBlockingINTEL(_RPipe, &TempData, m_Size, m_Alignment);
163 "Device-side API are not supported on a host device. Please use "
164 "host-side API instead.");
165 #endif // __SYCL_DEVICE_ONLY__
169 static constexpr int32_t m_Size =
sizeof(_dataT);
170 static constexpr int32_t m_Alignment =
alignof(_dataT);
171 static constexpr int32_t ID = _name::id;
172 #ifdef __SYCL_DEVICE_ONLY__
173 static constexpr
struct ConstantPipeStorage m_Storage
175 #endif // __SYCL_DEVICE_ONLY__
178 template <
class _name,
class _dataT,
size_t _min_capacity = 0>
186 static void write(
const _dataT &_Data,
bool &_Success) {
187 #ifdef __SYCL_DEVICE_ONLY__
188 __ocl_WPipeTy<_dataT> _WPipe =
189 __spirv_CreatePipeFromPipeStorage_write<_dataT>(&m_Storage);
190 _Success = !
static_cast<bool>(
191 __spirv_WritePipe(_WPipe, &_Data, m_Size, m_Alignment));
197 "Device-side API are not supported on a host device. Please use "
198 "host-side API instead.");
199 #endif // __SYCL_DEVICE_ONLY__
205 static void write(
const _dataT &_Data) {
206 #ifdef __SYCL_DEVICE_ONLY__
207 __ocl_WPipeTy<_dataT> _WPipe =
208 __spirv_CreatePipeFromPipeStorage_write<_dataT>(&m_Storage);
209 __spirv_WritePipeBlockingINTEL(_WPipe, &_Data, m_Size, m_Alignment);
214 "Device-side API are not supported on a host device. Please use "
215 "host-side API instead.");
216 #endif // __SYCL_DEVICE_ONLY__
220 static constexpr int32_t m_Size =
sizeof(_dataT);
221 static constexpr int32_t m_Alignment =
alignof(_dataT);
222 static constexpr int32_t ID = _name::id;
223 #ifdef __SYCL_DEVICE_ONLY__
224 static constexpr
struct ConstantPipeStorage m_Storage
226 #endif // __SYCL_DEVICE_ONLY__