DPCT1006#

Message#

SYCL does not provide a standard API to differentiate between integrated and discrete GPU devices.

Detailed Help#

The generated code uses a 0 (zero) as the value of this field.

Suggestions to Fix#

Consider re-implementing the code that depends on this field.

For example, this original CUDA* code:

 1void foo() {
 2  int device_number = 0;
 3    cudaDeviceProp prop;
 4    cudaGetDeviceProperties(&prop, device_number);
 5    if (prop.integrated) {
 6      ...
 7    } else {
 8      ...
 9    }
10}

results in the following migrated SYCL* code:

 1void foo() {
 2  int device_number = 0;
 3    dpct::device_info prop;
 4    dpct::dev_mgr::instance().get_device(device_number).get_device_info(prop);
 5    /*
 6    DPCT1006:0: SYCL does not provide a standard API to differentiate between
 7    integrated and discrete GPU devices.
 8    */
 9    if (prop.get_integrated()) {
10      ...
11    } else {
12      ...
13    }
14  }

which is rewritten to:

 1void foo() {
 2  int device_number = 0;
 3    dpct::device_info prop;
 4    // 1. User can use device name or other info to select device. The `a_device_name` can be obtained by running command `   sycl-ls`
 5    // 2. User can use the environment variable `ONEAPI_DEVICE_SELECTOR` to filter out some devices.
 6    // 3. User can use the user-provided device-selector like:
 7    //   int prefer_my_device(const sycl::device& d) {
 8    //     return d.get_info<info::device::name>() == "MyDevice";
 9    //   }
10    //   sycl::device preferred_device { prefer_my_device };
11    if (dpct::dev_mgr::instance().get_device(device_numbe).get_info<sycl::info::device::name>() == "a_device_name") {
12      ...
13    } else {
14      ...
15    }
16  }