Skip to content

Commit 11f73d6

Browse files
committed
With intel compiler, compare exception to sycl::errc::build
Signed-off-by: Matthew Michel <[email protected]>
1 parent 7020dc2 commit 11f73d6

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_utils.h

+7-6
Original file line numberDiff line numberDiff line change
@@ -850,15 +850,16 @@ __bypass_sycl_kernel_not_supported(const sycl::exception& __e)
850850
{
851851
// The SYCL spec compliant solution would be to compare __e.code() and sycl::errc::kernel_not_supported
852852
// and rethrow the encountered exception if the two do not compare equal. However, the icpx compiler currently
853-
// returns a generic error code in violation of the SYCL spec which has a value of 7. If we are using the Intel
854-
// compiler, then compare the value of the error code. Otherwise, assume the implementation is spec compliant.
853+
// returns a sycl::errc::build in violation of the SYCL spec. If we are using the Intel compiler, then compare
854+
// to this error code. Otherwise, assume the implementation is spec compliant.
855+
const std::error_code __kernel_not_supported_ec =
855856
#if _ONEDPL_SYCL_KERNEL_NOT_SUPPORTED_EXCEPTION_BROKEN
856-
if (__e.code().value() != 7)
857-
throw;
857+
sycl::errc::build;
858858
#else // Generic SYCL compiler. Assume it is spec compliant.
859-
if (__e.code() != sycl::errc::kernel_not_supported)
860-
throw;
859+
sycl::errc::kernel_not_supported;
861860
#endif
861+
if (__e.code() != __kernel_not_supported_ec)
862+
throw;
862863
}
863864

864865
} // namespace __par_backend_hetero

0 commit comments

Comments
 (0)