DPCT1101#
Message#
<expression text> expression was replaced with a value. Modify the code to use the original expression, provided in comments, if it is correct.
Detailed Help#
Identities, including constant variable names, types, and macros, used in the migrated SYCL* code are replaced with their value since they may not be available in the code scope. User can replace the value with the original expression listed in the comment manually after confirming that the identities are available in the code scope.
Suggestions to Fix#
Use a macro or const variable to replace the value.
For example, this original CUDA* code:
1 __global__ void f() {
2 const int x = 2;
3 __shared__ int fold[x];
4 ...
5 }
6
7 int main() {
8 f<<<1, 1>>>();
9 return 0;
10 }
results in the following migrated SYCL code:
1 void f(int *fold) {
2 const int x = 2;
3 ...
4 }
5
6 int main() {
7 dpct::get_in_order_queue().submit([&](sycl::handler &cgh) {
8 /*
9 DPCT1101:0: 'x' expression was replaced with a value. Modify the code to
10 use the original expression, provided in comments, if it is correct.
11 */
12 sycl::local_accessor<int, 1> fold_acc_ct1(sycl::range<1>(2 /*x*/), cgh);
13
14 cgh.parallel_for(
15 sycl::nd_range<3>(sycl::range<3>(1, 1, 1), sycl::range<3>(1, 1, 1)),
16 [=](sycl::nd_item<3> item_ct1) {
17 f(fold_acc_ct1.get_pointer());
18 });
19 });
20 return 0;
21 }
which is rewritten to:
1 const int x = 2;
2 void f(int *fold) {
3 ...
4 }
5
6 int main() {
7 dpct::get_in_order_queue().submit([&](sycl::handler &cgh) {
8 sycl::local_accessor<int, 1> fold_acc_ct1(sycl::range<1>(x), cgh);
9
10 cgh.parallel_for(
11 sycl::nd_range<3>(sycl::range<3>(1, 1, 1), sycl::range<3>(1, 1, 1)),
12 [=](sycl::nd_item<3> item_ct1) {
13 f(fold_acc_ct1.get_pointer());
14 });
15 });
16 return 0;
17 }