diff --git a/sycl/plugins/cuda/pi_cuda.cpp b/sycl/plugins/cuda/pi_cuda.cpp index 69cc74e299878..eccd74b5362ca 100644 --- a/sycl/plugins/cuda/pi_cuda.cpp +++ b/sycl/plugins/cuda/pi_cuda.cpp @@ -2824,9 +2824,10 @@ pi_result cuda_piextKernelSetArgMemObj(pi_kernel kernel, pi_uint32 arg_index, arrayDesc.Format != CU_AD_FORMAT_SIGNED_INT32 && arrayDesc.Format != CU_AD_FORMAT_HALF && arrayDesc.Format != CU_AD_FORMAT_FLOAT) { - sycl::detail::pi::die( - "PI CUDA kernels only support images with channel types int32, " - "uint32, float, and half."); + setErrorMessage("PI CUDA kernels only support images with channel " + "types int32, uint32, float, and half.", + PI_ERROR_PLUGIN_SPECIFIC_ERROR); + return PI_ERROR_PLUGIN_SPECIFIC_ERROR; } CUsurfObject cuSurf = arg_mem->mem_.surface_mem_.get_surface(); kernel->set_kernel_arg(arg_index, sizeof(cuSurf), (void *)&cuSurf);