Skip to content

Commit 2542e6a

Browse files
authored
[SYCL][CUDA] Make piextKernelSetArgMemObj setting an error message (#6521)
This patch makes `cuda_piextKernelSetArgMemObj` setting an error message instead of `std::terminate` in case of the image format is not supported. This error message is encapsulated in an exception thrown by the RT. This allows to continue the SYCL-CTS execution in case of tests using unsupported channel types, see #2119 (comment).
1 parent e94394a commit 2542e6a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sycl/plugins/cuda/pi_cuda.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2834,9 +2834,10 @@ pi_result cuda_piextKernelSetArgMemObj(pi_kernel kernel, pi_uint32 arg_index,
28342834
arrayDesc.Format != CU_AD_FORMAT_SIGNED_INT32 &&
28352835
arrayDesc.Format != CU_AD_FORMAT_HALF &&
28362836
arrayDesc.Format != CU_AD_FORMAT_FLOAT) {
2837-
sycl::detail::pi::die(
2838-
"PI CUDA kernels only support images with channel types int32, "
2839-
"uint32, float, and half.");
2837+
setErrorMessage("PI CUDA kernels only support images with channel "
2838+
"types int32, uint32, float, and half.",
2839+
PI_ERROR_PLUGIN_SPECIFIC_ERROR);
2840+
return PI_ERROR_PLUGIN_SPECIFIC_ERROR;
28402841
}
28412842
CUsurfObject cuSurf = arg_mem->mem_.surface_mem_.get_surface();
28422843
kernel->set_kernel_arg(arg_index, sizeof(cuSurf), (void *)&cuSurf);

0 commit comments

Comments
 (0)