Skip to content

Commit 614f7bb

Browse files
authored
[SYCLomatic][DOC] 2025.0 new options and warning messages (#2394)
* Updating DPCT Warning Messages and Option Descriptions for 2025.0 * Adding new DPCT warning messages for 2025.0
1 parent c541cf0 commit 614f7bb

File tree

9 files changed

+548
-37
lines changed

9 files changed

+548
-37
lines changed

docs/_include_files/options_def.rst

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ Stop migration and generation of reports if parsing errors happened. Default: ``
612612
.. _desc-suppress-warnings:
613613

614614
A comma-separated list of migration warnings to suppress. Valid warning IDs
615-
range from 1000 to 1127. Hyphen-separated ranges are also allowed. For
615+
range from 1000 to 1132. Hyphen-separated ranges are also allowed. For
616616
example: ``-suppress-warnings=1000-1010,1011``.
617617

618618
.. _end-suppress-warnings:
@@ -690,7 +690,9 @@ The values are:
690690
- ``=masked-sub-group-operation``: Experimental helper function used to execute
691691
sub-group operation with mask. See more details in ``dpct::experimental::select_from_sub_group``, ``dpct::experimental::shift_sub_group_left``, ``dpct::experimental::shift_sub_group_right`` and ``dpct::experimental::shift_sub_group_right`` in header file ``util.hpp``.
692692
- ``=matrix``: Experimental extension that allows use of matrix extension like class ``joint_matrix``. `See more details <https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/experimental/sycl_ext_matrix/sycl_ext_oneapi_matrix.asciidoc>`__.
693-
- ``=nd_range_barrier``: Experimental helper function used to help cross-group synchronization during migration. See more details in ``dpct::experimental::nd_range_barrier`` in header file ``util.hpp``.
693+
- ``=nd_range_barrier``: DEPRECATED. Experimental helper function used to help cross-group synchronization during migration. Please use the following option instead: ``--use-experimental-features=root-group``
694+
- ``=root-group``: Experimental extension that allows use of root group class and relative API.
695+
- ``=graph``: Experimental extension that allows use of SYCL Graph APIs.
694696
- ``=occupancy-calculation``: Experimental helper function used to calculate occupancy. See more details in ``dpct::experimental::calculate_max_active_wg_per_xecore`` and ``dpct::experimental::calculate_max_potential_wg`` in header file ``util.hpp``.
695697
- ``=user-defined-reductions``: Experimental extension that allows user-defined
696698
reductions. `See more details <https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/experimental/sycl_ext_oneapi_user_defined_reductions.asciidoc>`__.
@@ -710,11 +712,12 @@ The values are:
710712
.. _desc-use-explicit-namespace:
711713

712714
Define the namespaces to use explicitly in generated code. The value is
713-
a comma-separated list. Default: ``dpct, sycl``.
715+
a comma-separated list. Default: ``dpct/syclcompat, sycl``.
714716

715717
Possible values are:
716718

717719
- ``=dpct``: Generate code with ``dpct::`` namespace.
720+
- ``=syclcompat``: Generate code with ``syclcompat::`` namespace.
718721
- ``=none``: Generate code without any namespaces. Cannot be used with other values.
719722
- ``=sycl``: Generate code with ``sycl::`` namespace. Cannot be used with ``cl``
720723
or ``sycl-math`` values.
@@ -725,6 +728,18 @@ Possible values are:
725728

726729

727730

731+
.. _opt-use-syclcompat:
732+
733+
``--use-syclcompat``
734+
735+
.. _desc-use-syclcompat:
736+
737+
Use SYCLcompat header-only library (``syclcompat::`` namespace) to assist the migration of input source code. Default: ``off``.
738+
739+
.. _end-use-syclcompat:
740+
741+
742+
728743
.. _opt-usm-level:
729744

730745
``--usm-level=<value>``
@@ -739,6 +754,8 @@ Set the Unified Shared Memory (USM) level to use in source code generation:
739754

740755
.. _end-usm-level:
741756

757+
758+
742759
.. _opt-vcxprojfile:
743760

744761
``--vcxprojfile=<file>``
@@ -783,6 +800,7 @@ Same as -p.
783800
.. _end-compilation-db:
784801

785802

803+
786804
.. _opt-gen-helper-func:
787805

788806
``--gen-helper-function``
@@ -794,6 +812,7 @@ Generate helper function files in the ``--out-root`` directory. Default: ``off``
794812
.. _end-gen-helper-func:
795813

796814

815+
797816
.. _opt-analysis-mode:
798817

799818
``--analysis-mode``
@@ -805,6 +824,7 @@ Only generate a report for porting effort. Default: ``off``.
805824
.. _end-analysis-mode:
806825

807826

827+
808828
.. _opt-analysis-mode-output-file:
809829

810830
``--analysis-mode-output-file``
@@ -816,6 +836,7 @@ Specify the file where the analysis mode report is saved. Default: Output to ``s
816836
.. _end-analysis-mode-output-file:
817837

818838

839+
819840
.. _opt-codepin-report:
820841

821842
``--codepin-report``
@@ -826,6 +847,8 @@ Call ``codepin-report.py`` to generate CodePin report by parsing execution log f
826847

827848
.. _end-codepin-report:
828849

850+
851+
829852
.. _opt-enable-codepin:
830853

831854
``--enable-codepin``
@@ -837,6 +860,7 @@ EXPERIMENTAL: Generate instrumented CUDA and SYCL code for debug and verificatio
837860
.. _end-enable-codepin:
838861

839862

863+
840864
.. _opt-intercept-build:
841865

842866
``--intercept-build``
@@ -848,6 +872,7 @@ Intercept build tool to generate a compilation database.
848872
.. _end-intercept-build:
849873

850874

875+
851876
.. _opt-migrate-build-script:
852877

853878
``--migrate-build-script=<value>``
@@ -861,6 +886,7 @@ EXPERIMENTAL: Migrate build script(s).
861886
.. _end-migrate-build-script:
862887

863888

889+
864890
.. _opt-migrate-build-script-only:
865891

866892
``--migrate-build-script-only``
@@ -872,6 +898,7 @@ EXPERIMENTAL: Only migrate the build script(s). Default: ``off``.
872898
.. _end-migrate-build-script-only:
873899

874900

901+
875902
.. _opt-sycl-file-extension:
876903

877904
``--sycl-file-extension=<value>``
@@ -888,6 +915,7 @@ The values are:
888915
.. _end-sycl-file-extension:
889916

890917

918+
891919
.. _opt-intercept-build-block:
892920

893921
intercept-build Options

docs/dev_guide/reference/command-line-options-ref/alpha-list.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,12 @@ The following table lists |tool_name| command line options in alphabetical order
318318
- .. include:: /_include_files/options_def.rst
319319
:start-after: desc-use-explicit-namespace:
320320
:end-before: end-use-explicit-namespace:
321+
* - .. include:: /_include_files/options_def.rst
322+
:start-after: opt-use-syclcompat:
323+
:end-before: desc-use-syclcompat:
324+
- .. include:: /_include_files/options_def.rst
325+
:start-after: desc-use-syclcompat:
326+
:end-before: end-use-syclcompat:
321327
* - .. include:: /_include_files/options_def.rst
322328
:start-after: opt-usm-level:
323329
:end-before: desc-usm-level:
Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
11
.. _DPCT1087:
22

3-
DPCT1087
4-
========
3+
DPCT1087 [UPDATE]
4+
=================
55

66
Message
77
-------
88

99
.. _msg-1087-start:
1010

11-
SYCL currently does not support cross group synchronization. You can specify
12-
``--use-experimental-features=nd_range_barrier`` to use the dpct helper function
13-
``nd_range_barrier`` to migrate *<synchronization API call>*.
11+
SYCL currently does not support cross group synchronization. You can
12+
specify ``--use-experimental-features=root-group`` to use the root-group to migrate
13+
*<synchronization API call>*.
1414

1515
.. _msg-1087-end:
1616

1717
Detailed Help
1818
-------------
1919

20-
By default, the dpct helper function ``nd_range_barrier`` is not used to migrate
21-
CUDA\* grid level synchronization. To use ``nd_range_barrier`` to migrate CUDA
22-
grid level synchronization, specify ``--use-experimental-features=nd_range_barrier``
23-
in the migration command.
20+
By default, the SYCL root group extension is not used to migrate CUDA\* grid level
21+
synchronization. To use ``root-group`` to migrate CUDA grid level synchronization,
22+
specify ``--use-experimental-features=root-group`` in the migration command.
2423

2524
Suggestions to Fix
2625
------------------
2726

28-
Specify ``--use-experimental-features=nd_range_barrier`` in the migration command
29-
to use dpct helper function ``nd_range_barrier`` to migrate CUDA grid level
30-
synchronization.
27+
Specify ``--use-experimental-features= root-group`` in the migration command to use
28+
the root-group to migrate CUDA grid level synchronization.
3129

3230
For example, this original CUDA\* code:
3331

@@ -52,14 +50,19 @@ results in the following migrated SYCL code:
5250
void kernel() {
5351
5452
/*
55-
DPCT1087:1: SYCL currently does not support cross group synchronization. You
56-
can specify "--use-experimental-features=nd_range_barrier" to use the dpct
57-
helper function nd_range_barrier to migrate this_grid().
53+
DPCT1119:1: Migration of cooperative_groups::__v1::grid_group::this_grid is not
54+
supported, please try to remigrate with option:
55+
--use-experimental-features=root-group.
56+
*/
57+
/*
58+
DPCT1119:2: Migration of cooperative_groups::__v1::grid_group is not
59+
supported, please try to remigrate with option:
60+
--use-experimental-features=root-group.
5861
*/
5962
cg::grid_group grid = cg::this_grid();
6063
/*
6164
DPCT1087:0: SYCL currently does not support cross group synchronization. You
62-
can specify "--use-experimental-features=nd_range_barrier" to use the dpct
65+
can specify "--use-experimental-features=root-group" to use the dpct
6366
helper function nd_range_barrier to migrate grid.sync().
6467
*/
6568
grid.sync();
@@ -79,25 +82,18 @@ which is rewritten to:
7982
:linenos:
8083
8184
void kernel(const sycl::nd_item<3> &item_ct1,
82-
sycl::atomic_ref<unsigned int, sycl::memory_order::seq_cst, sycl::memory_scope::device, sycl::access::address_space::global_space> &sync_ct1) {
83-
84-
dpct::experimental::nd_range_barrier(item_ct1, sync_ct1);
85+
sycl::ext::oneapi::experimental::root_group grid =
86+
item_ct1.ext_oneapi_get_root_group();
87+
sycl::group_barrier(grid);
8588
}
8689
8790
void foo() {
88-
dpct::global_memory<unsigned int, 0> d_sync_ct1(0);
89-
unsigned *sync_ct1 = d_sync_ct1.get_ptr(dpct::get_in_order_queue());
90-
dpct::get_in_order_queue().memset(sync_ct1, 0, sizeof(int)).wait();
91-
dpct::get_in_order_queue()
92-
.parallel_for(
93-
sycl::nd_range<3>(sycl::range<3>(1, 1, 64), sycl::range<3>(1, 1, 64)),
91+
auto exp_props = sycl::ext::oneapi::experimental::properties{
92+
sycl::ext::oneapi::experimental::use_root_sync};
93+
dpct::get_in_order_queue().parallel_for(
94+
sycl::nd_range<3>(sycl::range<3>(1, 1, 64), sycl::range<3>(1, 1, 64)),
95+
exp_props, [=](sycl::nd_item<3> item_ct1) {
96+
kernel(item_ct1);
9497
[=](sycl::nd_item<3> item_ct1) {
95-
auto atm_sync_ct1 =
96-
sycl::atomic_ref<unsigned int, sycl::memory_order::seq_cst,
97-
sycl::memory_scope::device,
98-
sycl::access::address_space::global_space>(
99-
sync_ct1[0]);
100-
kernel(item_ct1, atm_sync_ct1);
101-
})
102-
.wait();
98+
});
10399
}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
.. _DPCT1130:
2+
3+
DPCT1130
4+
========
5+
6+
Message
7+
-------
8+
9+
.. _msg-1130-start:
10+
11+
SYCL 2020 standard does not support dynamic parallelism (launching kernel in device
12+
code). Please rewrite the code.
13+
14+
.. _msg-1130-end:
15+
16+
Detailed Help
17+
-------------
18+
19+
SYCL\* does not support launching kernel in device code. The user needs to merge the
20+
parent kernel and child kernel together.
21+
22+
Suggestions to Fix
23+
------------------
24+
25+
For example, this original CUDA\* code:
26+
27+
.. code-block:: cpp
28+
:linenos:
29+
30+
__global__ void childKernel() {
31+
...
32+
}
33+
__global__ void parentKernel() {
34+
...
35+
childKernel<<<4, 4>>>();
36+
...
37+
}
38+
void foo() {
39+
...
40+
parentKernel<<<8, 8>>>();
41+
...
42+
}
43+
44+
results in the following migrated SYCL code:
45+
46+
.. code-block:: cpp
47+
:linenos:
48+
49+
void childKernel() {
50+
...
51+
}
52+
void parentKernel() {
53+
...
54+
/*
55+
DPCT1130:0: SYCL 2020 standard does not support dynamic parallelism (launching
56+
kernel in device code). Please rewrite the code.
57+
*/
58+
childKernel<<<4, 4>>>();
59+
...
60+
}
61+
void foo() {
62+
...
63+
dpct::get_in_order_queue().parallel_for(
64+
sycl::nd_range<3>(sycl::range<3>(1, 1, 8) * sycl::range<3>(1, 1, 8),
65+
sycl::range<3>(1, 1, 8)),
66+
[=](sycl::nd_item<3> item_ct1) {
67+
parentKernel();
68+
});
69+
...
70+
}
71+
72+
which is rewritten to:
73+
74+
.. code-block:: cpp
75+
:linenos:
76+
77+
void childKernel() {
78+
...
79+
}
80+
void parentKernel() {
81+
...
82+
childKernel(); // call childKernel() as a device function, need to adjust the work
83+
for each work item.
84+
...
85+
}
86+
void foo() {
87+
...
88+
dpct::get_in_order_queue().parallel_for(
89+
sycl::nd_range<3>(sycl::range<3>(1, 1, placeholder /*Adjust the global range
90+
based on the thread model between parentKernel and childKernel*/),
91+
sycl::range<3>(1, 1, placeholder /*Adjust the local range
92+
based on the thread model between parentKernel and
93+
childKernel */)),
94+
[=](sycl::nd_item<3> item_ct1) {
95+
parentKernel();
96+
});
97+
...
98+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.. _DPCT1131:
2+
3+
DPCT1131
4+
========
5+
6+
Message
7+
-------
8+
9+
.. _msg-1131-start:
10+
11+
The migration of "*<API name>*" is not currently supported with SYCLcompat. Please
12+
adjust the code manually.
13+
14+
.. _msg-1131-end:
15+
16+
Detailed Help
17+
-------------
18+
19+
When using syclcompat header-only library to assist the migration, this API migration is
20+
not supported.
21+
22+
Suggestions to Fix
23+
------------------
24+
25+
This kind of code requires manual migration to SYCL\*. Please refer to the migration
26+
result without specifying “--use-syclcompat”.

0 commit comments

Comments
 (0)