DPCT1043#
Message#
The version-related API is different in SYCL. An initial code was generated, but you need to adjust it.
Detailed Help#
The generated code uses sycl::info::device::version
, which provides different
information and uses a different type than the original code.
Suggestions to Fix#
Adjust the generated code.
For example, this original CUDA* code:
1 void foo() {
2 int version;
3 cudaDriverGetVersion(&version);
4 if (version >= 12000) {
5 code path 1
6 } else {
7 code path 2
8 }
9 }
results in the following migrated SYCL* code:
1 void foo() {
2 int version;
3 /*
4 DPCT1043:0: The version-related API is different in SYCL. An initial code was
5 generated, but you need to adjust it.
6 */
7 version = dpct::get_current_device().get_major_version();
8 if (version >= 12000) {
9 ...
10 } else {
11 ...
12 }
13 }
which is rewritten to:
1 void foo() {
2 code path 1
3 }