Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*

Nd-range groups

alex2671
Beginner
477 Views
Greetings! I would like to answer a question how the partitioning in nd-range works.

I have a sycl::nd_range<2>(sycl::range<2>(6,3), sycl::range<2>(6,1)...) and expected to partition with 18/6=3 groups, however when i use item.get_group it shows that i have only one, zero number, group. Therefore how to make a 3 groups or, if its impossible with this approach, how to make a loop like in pseudocode:

Total =6
Groups=3
NinGroup=Total/Groups
For(i=0, i<5, i++)
For(ii in TotalNinGroup)
0 Kudos
2 Replies
alex2671
Beginner
446 Views
Solved a problem. I used to obtain group id as get_group(0), however should be get_group(1).
0 Kudos
mbwhatpapp
Beginner
86 Views

I’ve been working with  and work-group sizes in DPC++ recently, and I agree this can be confusing at first. One tip that helped me was to start with simple, evenly divisible global and local sizes so you can clearly see how  and behave. Once that’s working, you can adjust for performance. Also pay attention to how the work-group size affects memory access and barriers mismatched sizes or non-uniform divisions often lead to unexpected behavior. If you can share the specific kernel and the sizes you’re using, it might be easier to pinpoint where the issue is happening.

0 Kudos
Reply