DPCT1093#

Message#

The <Device ID> device may be not the one intended for use. Adjust the selected device if needed.

Detailed Help#

The cudaSetDevice function sets the device to run the code on. After migration to SYCL*, the logic for device selection may need to be updated.

For example, this original CUDA* code:

1  int main( int argc, char** argv) {
2      cudaSetDevice(1); // Device 1 is the best choice in the original code.
3      foo(argc, argv);
4  }

results in the following migrated SYCL code:

1  int main( int argc, char** argv) {
2      /*   DPCT1093   */
3      dpct::dev_mgr::instance().select_device(1); // Device 1 maybe not the best choice in SYCL.
4      foo(argc, argv);
5  }

which is manually adjusted to:

1  int main( int argc, char** argv) {
2      dpct::dev_mgr::instance().select_device(0);
3      foo(argc, argv);
4  }

Suggestions to Fix#

Review and adjust the device selection logic if needed.