@@ -2980,18 +2980,32 @@ argument to **clEnqueueNDRangeKernel** (in OpenCL) or to
2980
2980
**parallel_for** in SYCL. This allows the compiler to optimize the
2981
2981
generated code appropriately for the kernel to which attribute is applied.
2982
2982
2983
- While semantic of this attribute is the same between OpenCL and SYCL,
2984
- spelling is a bit different:
2985
-
2986
- SYCL 2020 describes the ``[[sycl::reqd_work_group_size(X, Y, Z)]]`` spelling
2987
- in detail. This attribute indicates that the kernel must be launched with the
2988
- specified work-group size. The order of the arguments matches the constructor
2989
- of the group class. Each argument to the attribute must be an integral constant
2990
- expression. The dimensionality of the attribute variant used must match the
2991
- dimensionality of the work-group used to invoke the kernel. This spelling
2992
- allows the Y and Z arguments to be optional. If not provided by the user, the
2993
- value of Y and Z defaults to 1. See section 5.8.1 Kernel Attributes for more
2994
- details.
2983
+ The arguments to ``reqd_work_group_size`` are ordered based on which index
2984
+ increments the fastest. In OpenCL, the first argument is the index that
2985
+ increments the fastest. In SYCL, the last argument is the index that increments
2986
+ the fastest.
2987
+
2988
+ In OpenCL C, this attribute is available with the GNU spelling
2989
+ (``__attribute__((reqd_work_group_size(X, Y, Z)))``) and all three arguments
2990
+ are required. See section 6.7.2 Optional Attribute Qualifiers of OpenCL 1.2
2991
+ specification for details.
2992
+
2993
+ .. code-block:: c++
2994
+
2995
+ __kernel __attribute__((reqd_work_group_size(8, 16, 32))) void test() {}
2996
+
2997
+ In SYCL, the attribute accepts either one, two, or three arguments; in each
2998
+ form, the last (or only) argument is the index that increments fastest. The
2999
+ number of arguments passed to the attribute must match the dimensionality of
3000
+ the kernel the attribute is applied to.
3001
+
3002
+ SYCL 2020 describes the ``[[sycl::reqd_work_group_size(dim0, dim1, dim2)]]``
3003
+ spelling in detail. This attribute indicates that the kernel must be launched
3004
+ with the specified work-group size. The order of the arguments matches the
3005
+ constructor of the ``range`` class. Each argument to the attribute must be an
3006
+ integral constant expression. The dimensionality of the attribute variant used
3007
+ must match the dimensionality of the work-group used to invoke the kernel. See
3008
+ section 5.8.1 Kernel Attributes for more details.
2995
3009
2996
3010
In SYCL 1.2.1 mode, the ``cl::reqd_work_group_size`` and
2997
3011
``sycl::reqd_work_group_size`` attributes are propagated from the function they
@@ -3016,18 +3030,9 @@ attributes are not propagated to the kernel.
3016
3030
template <int N, int N1, int N2>
3017
3031
[[sycl::reqd_work_group_size(N, N1, N2)]] void func() {}
3018
3032
3019
- The ``[[cl::reqd_work_group_size(X, Y, Z )]]`` and
3020
- ``__attribute__((reqd_work_group_size(X, Y, Z )))`` spellings are both
3033
+ The ``[[cl::reqd_work_group_size(dim0, dim1, dim2 )]]`` and
3034
+ ``__attribute__((reqd_work_group_size(dim0, dim1, dim2 )))`` spellings are both
3021
3035
deprecated in SYCL 2020.
3022
-
3023
- In OpenCL C, this attribute is available with the GNU spelling
3024
- (``__attribute__((reqd_work_group_size(X, Y, Z)))``), see section
3025
- 6.7.2 Optional Attribute Qualifiers of OpenCL 1.2 specification for details.
3026
-
3027
- .. code-block:: c++
3028
-
3029
- __kernel __attribute__((reqd_work_group_size(8, 16, 32))) void test() {}
3030
-
3031
3036
}];
3032
3037
}
3033
3038
@@ -3041,6 +3046,15 @@ unsigned. The number of dimensional values defined provide additional
3041
3046
information to the compiler on the dimensionality most likely to be used when
3042
3047
launching the kernel at runtime.
3043
3048
3049
+ The arguments to ``work_group_size_hint`` are ordered based on which index
3050
+ increments the fastest. In OpenCL, the first argument is the index that
3051
+ increments the fastest. In SYCL, the last argument is the index that increments
3052
+ the fastest.
3053
+
3054
+ In OpenCL C, this attribute is available with the GNU spelling
3055
+ (``__attribute__((work_group_size_hint(X, Y, Z)))``) and all three arguments
3056
+ are required.
3057
+
3044
3058
The GNU spelling is deprecated in SYCL mode.
3045
3059
3046
3060
.. code-block:: c++
@@ -3052,15 +3066,6 @@ The GNU spelling is deprecated in SYCL mode.
3052
3066
[[sycl::work_group_size_hint(2, 2, 2)]] void operator()() const {}
3053
3067
};
3054
3068
3055
- The arguments to ``work_group_size_hint`` are ordered based on which index
3056
- increments the fastest. In OpenCL, the first argument is the index that
3057
- increments the fastest, and in SYCL, the last argument is the index that
3058
- increments the fastest.
3059
-
3060
- In OpenCL C, this attribute is available with the GNU spelling
3061
- (``__attribute__((work_group_size_hint(X, Y, Z)))``) and all
3062
- three arguments are required.
3063
-
3064
3069
In SYCL, the attribute accepts either one, two, or three arguments; in each
3065
3070
form, the last (or only) argument is the index that increments fastest. The
3066
3071
number of arguments passed to the attribute must match the dimensionality of
@@ -3077,9 +3082,11 @@ def SYCLIntelMaxWorkGroupSizeAttrDocs : Documentation {
3077
3082
let Heading = "intel::max_work_group_size";
3078
3083
let Content = [{
3079
3084
Applies to a device function/lambda function. Indicates the maximum dimensions
3080
- of a work group. Values must be positive integers. This is similar to
3081
- reqd_work_group_size, but allows work groups that are smaller or equal to the
3082
- specified sizes.
3085
+ of a work group. Values must be positive integers. This attribute behaves
3086
+ similarly to ``reqd_work_group_size``, but allows work groups that are smaller
3087
+ or equal to the specified sizes. The dimensionality behaves the same as with
3088
+ the SYCL ``reqd_work_group_size`` attribute, but *all* dimensions must be
3089
+ provided.
3083
3090
3084
3091
In SYCL 1.2.1 mode, the ``intel::max_work_group_size`` attribute is propagated
3085
3092
from the function it is applied to onto the kernel which calls the function.
0 commit comments