Skip to content

Commit fba2e06

Browse files
MrSidimsbader
authored andcommitted
[NFC][SYCL] Update cl::intel_reqd_sub_group_size attribute documentation (#1009)
Signed-off-by: Dmitry Sidorov <[email protected]>
1 parent f537293 commit fba2e06

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

clang/include/clang/Basic/AttrDocs.td

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3310,7 +3310,8 @@ must be compiled and executed with a sub-group of size n. The value of n must be
33103310
set to a sub-group size supported by the device, or device compilation will fail.
33113311

33123312
In addition to device functions, the required sub-group size attribute may also
3313-
be specified in the definition of a named functor object, as in the example below:
3313+
be specified in the definition of a named functor object and lambda functions,
3314+
as in the examples below:
33143315

33153316
.. code-block:: c++
33163317

@@ -3322,6 +3323,11 @@ be specified in the definition of a named functor object, as in the example belo
33223323
}
33233324
}
33243325

3326+
kernel<class kernel_name>(
3327+
[]() [[cl::intel_reqd_sub_group_size(n)]] {
3328+
/* kernel code */
3329+
});
3330+
33253331
See Sub-groups for NDRange Parallelism proposal in sycl/doc/extensions/sub_group_ndrange/sub_group_ndrange.md
33263332
}];
33273333
}

sycl/doc/extensions/SubGroupNDRange/SubGroupNDRange.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ In keeping with Section 6.7 of the SYCL 1.2.1 specification, attributes are made
3535

3636
The `[[cl::intel_reqd_sub_group_size(n)]]` attribute indicates that the kernel must be compiled and executed with a sub-group of size `n`. The value of `n` must be set to a sub-group size supported by the device, or device compilation will fail.
3737

38-
In addition to device functions, the required sub-group size attribute may also be specified in the definition of a named functor object, as in the example below:
38+
In addition to device functions, the required sub-group size attribute may also be specified in the definition of a named functor object and lambda functions, as in the examples below:
3939

4040
```c++
4141
class Functor
@@ -45,6 +45,11 @@ class Functor
4545
/* kernel code */
4646
}
4747
}
48+
49+
kernel<class kernel_name>(
50+
[]() [[cl::intel_reqd_sub_group_size(n)]] {
51+
/* kernel code */
52+
});
4853
```
4954

5055
# Sub-group Queries

0 commit comments

Comments
 (0)