@@ -34,7 +34,9 @@ template <class _name, class _dataT, int32_t _min_capacity = 0> class pipe {
3434 return TempData;
3535#else
3636 (void )_Success;
37- assert (!" Pipes are not supported on a host device!" );
37+ throw sycl::exception (
38+ sycl::make_error_code (sycl::errc::feature_not_supported),
39+ " Pipes are not supported on a host device." );
3840#endif // __SYCL_DEVICE_ONLY__
3941 }
4042
@@ -49,7 +51,9 @@ template <class _name, class _dataT, int32_t _min_capacity = 0> class pipe {
4951#else
5052 (void )_Success;
5153 (void )_Data;
52- assert (!" Pipes are not supported on a host device!" );
54+ throw sycl::exception (
55+ sycl::make_error_code (sycl::errc::feature_not_supported),
56+ " Pipes are not supported on a host device." );
5357#endif // __SYCL_DEVICE_ONLY__
5458 }
5559
@@ -64,7 +68,9 @@ template <class _name, class _dataT, int32_t _min_capacity = 0> class pipe {
6468 __spirv_ReadPipeBlockingINTEL (_RPipe, &TempData, m_Size, m_Alignment);
6569 return TempData;
6670#else
67- assert (!" Pipes are not supported on a host device!" );
71+ throw sycl::exception (
72+ sycl::make_error_code (sycl::errc::feature_not_supported),
73+ " Pipes are not supported on a host device." );
6874#endif // __SYCL_DEVICE_ONLY__
6975 }
7076
@@ -77,7 +83,9 @@ template <class _name, class _dataT, int32_t _min_capacity = 0> class pipe {
7783 __spirv_WritePipeBlockingINTEL (_WPipe, &_Data, m_Size, m_Alignment);
7884#else
7985 (void )_Data;
80- assert (!" Pipes are not supported on a host device!" );
86+ throw sycl::exception (
87+ sycl::make_error_code (sycl::errc::feature_not_supported),
88+ " Pipes are not supported on a host device." );
8189#endif // __SYCL_DEVICE_ONLY__
8290 }
8391
@@ -128,7 +136,9 @@ class kernel_readable_io_pipe {
128136 return TempData;
129137#else
130138 (void )_Success;
131- assert (!" Pipes are not supported on a host device!" );
139+ throw sycl::exception (
140+ sycl::make_error_code (sycl::errc::feature_not_supported),
141+ " Pipes are not supported on a host device." );
132142#endif // __SYCL_DEVICE_ONLY__
133143 }
134144
@@ -143,7 +153,9 @@ class kernel_readable_io_pipe {
143153 __spirv_ReadPipeBlockingINTEL (_RPipe, &TempData, m_Size, m_Alignment);
144154 return TempData;
145155#else
146- assert (!" Pipes are not supported on a host device!" );
156+ throw sycl::exception (
157+ sycl::make_error_code (sycl::errc::feature_not_supported),
158+ " Pipes are not supported on a host device." );
147159#endif // __SYCL_DEVICE_ONLY__
148160 }
149161
@@ -174,7 +186,9 @@ class kernel_writeable_io_pipe {
174186#else
175187 (void )_Data;
176188 (void )_Success;
177- assert (!" Pipes are not supported on a host device!" );
189+ throw sycl::exception (
190+ sycl::make_error_code (sycl::errc::feature_not_supported),
191+ " Pipes are not supported on a host device." );
178192#endif // __SYCL_DEVICE_ONLY__
179193 }
180194
@@ -188,7 +202,9 @@ class kernel_writeable_io_pipe {
188202 __spirv_WritePipeBlockingINTEL (_WPipe, &_Data, m_Size, m_Alignment);
189203#else
190204 (void )_Data;
191- assert (!" Pipes are not supported on a host device!" );
205+ throw sycl::exception (
206+ sycl::make_error_code (sycl::errc::feature_not_supported),
207+ " Pipes are not supported on a host device." );
192208#endif // __SYCL_DEVICE_ONLY__
193209 }
194210
0 commit comments