diff --git a/sycl/include/sycl/ext/intel/experimental/pipes.hpp b/sycl/include/sycl/ext/intel/experimental/pipes.hpp index f4521f963645c..c74360f7ebc66 100644 --- a/sycl/include/sycl/ext/intel/experimental/pipes.hpp +++ b/sycl/include/sycl/ext/intel/experimental/pipes.hpp @@ -75,7 +75,9 @@ class pipe<_name, _dataT, _min_capacity, _propertiesT, #else (void)Success; (void)Properties; - assert(!"Pipes are not supported on a host device!"); + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Pipes are not supported on a host device."); #endif // __SYCL_DEVICE_ONLY__ } @@ -122,7 +124,9 @@ class pipe<_name, _dataT, _min_capacity, _propertiesT, (void)Success; (void)Data; (void)Properties; - assert(!"Pipes are not supported on a host device!"); + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Pipes are not supported on a host device."); #endif // __SYCL_DEVICE_ONLY__ } @@ -169,7 +173,9 @@ class pipe<_name, _dataT, _min_capacity, _propertiesT, return TempData; #else (void)Properties; - assert(!"Pipes are not supported on a host device!"); + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Pipes are not supported on a host device."); #endif // __SYCL_DEVICE_ONLY__ } @@ -212,7 +218,9 @@ class pipe<_name, _dataT, _min_capacity, _propertiesT, #else (void)Data; (void)Properties; - assert(!"Pipes are not supported on a host device!"); + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Pipes are not supported on a host device."); #endif // __SYCL_DEVICE_ONLY__ } diff --git a/sycl/include/sycl/ext/intel/pipes.hpp b/sycl/include/sycl/ext/intel/pipes.hpp index 9ff3d1241e317..e05d1b2e35f0e 100644 --- a/sycl/include/sycl/ext/intel/pipes.hpp +++ b/sycl/include/sycl/ext/intel/pipes.hpp @@ -34,7 +34,9 @@ template class pipe { return TempData; #else (void)_Success; - assert(!"Pipes are not supported on a host device!"); + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Pipes are not supported on a host device."); #endif // __SYCL_DEVICE_ONLY__ } @@ -49,7 +51,9 @@ template class pipe { #else (void)_Success; (void)_Data; - assert(!"Pipes are not supported on a host device!"); + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Pipes are not supported on a host device."); #endif // __SYCL_DEVICE_ONLY__ } @@ -64,7 +68,9 @@ template class pipe { __spirv_ReadPipeBlockingINTEL(_RPipe, &TempData, m_Size, m_Alignment); return TempData; #else - assert(!"Pipes are not supported on a host device!"); + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Pipes are not supported on a host device."); #endif // __SYCL_DEVICE_ONLY__ } @@ -77,7 +83,9 @@ template class pipe { __spirv_WritePipeBlockingINTEL(_WPipe, &_Data, m_Size, m_Alignment); #else (void)_Data; - assert(!"Pipes are not supported on a host device!"); + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Pipes are not supported on a host device."); #endif // __SYCL_DEVICE_ONLY__ } @@ -128,7 +136,9 @@ class kernel_readable_io_pipe { return TempData; #else (void)_Success; - assert(!"Pipes are not supported on a host device!"); + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Pipes are not supported on a host device."); #endif // __SYCL_DEVICE_ONLY__ } @@ -143,7 +153,9 @@ class kernel_readable_io_pipe { __spirv_ReadPipeBlockingINTEL(_RPipe, &TempData, m_Size, m_Alignment); return TempData; #else - assert(!"Pipes are not supported on a host device!"); + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Pipes are not supported on a host device."); #endif // __SYCL_DEVICE_ONLY__ } @@ -174,7 +186,9 @@ class kernel_writeable_io_pipe { #else (void)_Data; (void)_Success; - assert(!"Pipes are not supported on a host device!"); + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Pipes are not supported on a host device."); #endif // __SYCL_DEVICE_ONLY__ } @@ -188,7 +202,9 @@ class kernel_writeable_io_pipe { __spirv_WritePipeBlockingINTEL(_WPipe, &_Data, m_Size, m_Alignment); #else (void)_Data; - assert(!"Pipes are not supported on a host device!"); + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Pipes are not supported on a host device."); #endif // __SYCL_DEVICE_ONLY__ }