Visible to Intel only — GUID: GUID-CA093D84-A6D4-44C2-A422-8124A07AB1D6
Visible to Intel only — GUID: GUID-CA093D84-A6D4-44C2-A422-8124A07AB1D6
DPCT1009
Message
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.
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() {
float *f;
int err = (f = (float *)sycl::malloc_device(4, dpct::get_default_queue()), 0);
/*
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",
"cudaGetErrorString is not supported" /*cudaGetErrorString(err)*/);
}
which is rewritten to:
void foo() {
float *f;
try {
f = (float *)sycl::malloc_device(4, dpct::get_default_queue())
} catch (sycl::exception const &e) {
std::cerr << e.what() << std::endl;
}
}