Skip to content

[SYCL] Throw exception for pipe extension on host #6385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions sycl/include/sycl/ext/intel/experimental/pipes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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__
}

Expand Down Expand Up @@ -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__
}

Expand Down Expand Up @@ -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__
}

Expand Down Expand Up @@ -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__
}

Expand Down
32 changes: 24 additions & 8 deletions sycl/include/sycl/ext/intel/pipes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ template <class _name, class _dataT, int32_t _min_capacity = 0> 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__
}

Expand All @@ -49,7 +51,9 @@ template <class _name, class _dataT, int32_t _min_capacity = 0> 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__
}

Expand All @@ -64,7 +68,9 @@ template <class _name, class _dataT, int32_t _min_capacity = 0> 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__
}

Expand All @@ -77,7 +83,9 @@ template <class _name, class _dataT, int32_t _min_capacity = 0> 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__
}

Expand Down Expand Up @@ -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__
}

Expand All @@ -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__
}

Expand Down Expand Up @@ -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__
}

Expand All @@ -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__
}

Expand Down