DPCT1024#

Message#

The original code returned the error code that was further consumed by the program logic. This original code was replaced with 0. You may need to rewrite the program logic consuming the error code.

Detailed Help#

This warning is generated in cases where in the original code, the CUDA* API call returns the error code, which is consumed by the program logic:

handleError(cudaEventRecord(e));

If in the resulting code the CUDA API call is replaced by the code, which does not return the error code, 0 is used as an input to the program logic, consuming the error code:

e_ct1 = clock(), handleError(0);

The error handling code in that case must be verified and may require replacing it with exception handling code or removed completely.

Suggestions to Fix#

Verify the code correctness.

For example, this original CUDA code:

1void foo() {
2  cudaEvent_t e;
3  ...
4  handleError(cudaEventRecord(e));
5  ...
6}

results in the following migrated SYCL* code:

 1void foo() {
 2  dpct::event_ptr e;
 3  std::chrono::time_point<std::chrono::steady_clock> e_ct1;
 4  ...
 5  /*
 6  DPCT1024:1: The original code returned the error code that was further
 7  consumed by the program logic. This original code was replaced with 0. You may
 8  need to rewrite the program logic consuming the error code.
 9  */
10  e_ct1 = std::chrono::steady_clock::now();
11  handleError(0);
12  ...
13}

which is rewritten to:

1void foo() {
2  dpct::event_ptr e;
3  std::chrono::time_point<std::chrono::steady_clock> e_ct1;
4  ...
5  e_ct1 = std::chrono::steady_clock::now();
6  ...
7}