Visible to Intel only — GUID: GUID-0F125E3F-0A55-4E5A-813C-8741BB1642FA
Visible to Intel only — GUID: GUID-0F125E3F-0A55-4E5A-813C-8741BB1642FA
DPCT1009
Message
SYCL reports errors using exceptions and does not use error codes. Please replace the "get_error_string_dummy(…)" with a real error-handling function.
Detailed Help
SYCL* uses exceptions to report errors and does not use error codes. The original code tries to get a string message through the error code, while SYCL does not require such functionality.
To indicate that the code needs to be updated, a warning string is inserted.
Suggestions to Fix
You may need to rewrite this code.
For example, this original CUDA* code:
void foo() {
float *f;
cudaError_t err = cudaMalloc(&f, 4);
printf("%s\n", cudaGetErrorString(err));
}
results in the following migrated SYCL code:
void foo() try {
float *f;
dpct::err0 err = DPCT_CHECK_ERROR(
f = (float *)sycl::malloc_device(4, dpct::get_in_order_queue()));
/*
DPCT1009:1: SYCL uses exceptions to report errors and does not use the error
codes. The original code was commented out and a warning string was inserted.
You need to rewrite this code.
*/
printf("%s\n", dpct::get_error_string_dummy(err));
}
catch (sycl::exception const &exc) {
std::cerr <<exc.what() << "Exception caught at file." << __FILE__
<< ", line:" << __LINE__ << std:endl;
std::exit(1);
}
which needs to be rewritten to:
void foo() {
float *f;
try {
f = (float *)sycl::malloc_device(4, dpct::get_in_order_queue())
} catch (sycl::exception const &e) {
std::cerr << e.what() << std::endl;
}
}