DPCT1088#

Message#

The macro definition has multiple migration results in the dimension of free queries function that could not be unified. You may need to modify the code.

Detailed Help#

SYCLomatic was unable to migrate the code correctly. You need to modify the code manually.

For example, this original CUDA* code:

 1  namespace cg = cooperative_groups;
 2
 3  #define TB(b) cg::thread_block b = cg::this_thread_block();
 4
 5  __global__ void test1() {
 6    TB(b);
 7  }
 8
 9  __global__ void test2() {
10    TB(b);
11  }
12
13  void foo() {
14    test1<<<dim3(2, 2, 2), dim3(2, 2, 2)>>>();
15    test2<<<2, 2>>>();
16  }

migrated with options --assume-nd-range-dim=1 and --use-experimental-features=free-function-queries, results in the following migrated SYCL code:

 1  /*
 2  DPCT1088:0: The macro definition has multiple migration results in the dimension
 3  of free queries function that could not be unified. You may need to modify the
 4  code.
 5  */
 6  #define TB(b)                                                                  \
 7    auto b = sycl::ext::oneapi::experimental::this_group<                        \
 8        dpct_placeholder /* Fix the dimension manually */>();
 9
10  void test1() {
11    TB(b);
12  }
13
14  void test2() {
15    TB(b);
16  }
17
18  void foo() {
19    sycl::device dev_ct1;
20    sycl::queue q_ct1(dev_ct1,
21                      sycl::property_list{sycl::property::queue::in_order()});
22    q_ct1.parallel_for(
23        sycl::nd_range<3>(sycl::range<3>(2, 2, 2) * sycl::range<3>(2, 2, 2),
24                          sycl::range<3>(2, 2, 2)),
25        [=](sycl::nd_item<3> item_ct1) {
26          test1();
27        });
28    q_ct1.parallel_for(sycl::nd_range<1>(sycl::range<1>(2) * sycl::range<1>(2),
29                                         sycl::range<1>(2)),
30                       [=](sycl::nd_item<1> item_ct1) {
31                         test2();
32                       });
33  }

which is manually adjusted to:

 1  #define TB(b, d)                                                                  \
 2    auto b = sycl::ext::oneapi::experimental::this_group<d>();
 3
 4  void test1() {
 5    TB(b, 3);
 6  }
 7
 8  void test2() {
 9    TB(b, 1);
10  }
11
12  void foo() {
13    sycl::device dev_ct1;
14    sycl::queue q_ct1(dev_ct1,
15                      sycl::property_list{sycl::property::queue::in_order()});
16    q_ct1.parallel_for(
17        sycl::nd_range<3>(sycl::range<3>(2, 2, 2) * sycl::range<3>(2, 2, 2),
18                          sycl::range<3>(2, 2, 2)),
19        [=](sycl::nd_item<3> item_ct1) {
20          test1();
21        });
22    q_ct1.parallel_for(sycl::nd_range<1>(sycl::range<1>(2) * sycl::range<1>(2),
23                                         sycl::range<1>(2)),
24                       [=](sycl::nd_item<1> item_ct1) {
25                         test2();
26                       });
27  }

Suggestions to Fix#

Rewrite the code manually.