@@ -117,14 +117,10 @@ supports.
117117
118118=== Kernel Properties
119119
120- Most of the kernel properties below correspond to kernel attributes defined in
120+ The kernel properties below correspond to kernel attributes defined in
121121Section 5.8.1 of the SYCL 2020 specification. Note that deprecated attributes
122122(such as `vec_type_hint`) are not included.
123123
124- The `max_work_group_size` and `max_linear_work_group_size` kernel properties
125- are also provided as complements to other properties concerning work-group
126- sizes, without a corresponding function attribute form.
127-
128124```c++
129125namespace sycl {
130126namespace ext {
@@ -143,16 +139,6 @@ struct work_group_size_hint_key {
143139 using value_t = property_value<work_group_size_hint_key, std::integral_constant<size_t, Dims>...>;
144140}; // work_group_size_hint_key
145141
146- struct max_work_group_size_key {
147- template <size_t... Dims>
148- using value_t = property_value<max_work_group_size_key, std::integral_constant<size_t, Dims>...>;
149- }; // max_work_group_size_key
150-
151- struct max_linear_work_group_size_key {
152- template <size_t Size>
153- using value_t = property_value<max_linear_work_group_size_key, std::integral_constant<size_t, Size>>;
154- }; // max_linear_work_group_size_key
155-
156142// Corresponds to reqd_sub_group_size
157143struct sub_group_size_key {
158144 template <uint32_t Size>
@@ -189,12 +175,6 @@ inline constexpr work_group_size_key::value_t<Dims...> work_group_size;
189175template <size_t... Dims>
190176inline constexpr work_group_size_hint_key::value_t<Dims...> work_group_size_hint;
191177
192- template <size_t... Dims>
193- inline constexpr max_work_group_size_key::value_t<Dims...> max_work_group_size;
194-
195- template <size_t Size>
196- inline constexpr max_linear_work_group_size_key::value_t<Size> max_linear_work_group_size;
197-
198178template <uint32_t Size>
199179inline constexpr sub_group_size_key::value_t<Size> sub_group_size;
200180
@@ -203,8 +183,6 @@ inline constexpr device_has_key::value_t<Aspects...> device_has;
203183
204184template <> struct is_property_key<work_group_size_key> : std::true_type {};
205185template <> struct is_property_key<work_group_size_hint_key> : std::true_type {};
206- template <> struct is_property_key<max_work_group_size_key> : std::true_type {};
207- template <> struct is_property_key<max_linear_work_group_size_key> : std::true_type {};
208186template <> struct is_property_key<sub_group_size_key> : std::true_type {};
209187template <> struct is_property_key<device_has_key> : std::true_type {};
210188
@@ -234,6 +212,67 @@ template <> struct is_property_key<device_has_key> : std::true_type {};
234212 of the work-group used to invoke the kernel. The order of the template
235213 arguments matches the constructor of the `range` class.
236214
215+ |`sub_group_size`
216+ |The `sub_group_size` property adds the requirement that the kernel must be
217+ compiled and executed with the specified sub-group size. An implementation may
218+ throw an exception for certain combinations of property values, devices and
219+ launch configurations, as described for the `reqd_sub_group_size` attribute
220+ in Table 180 of the SYCL 2020 specification.
221+
222+ |`device_has`
223+ |The `device_has` property adds the requirement that the kernel must be
224+ launched on a device that has all of the aspects listed in the `Aspects`
225+ parameter pack. An implementation may throw an exception or issue a
226+ diagnostic for certain combinations of aspects, devices and kernel functions,
227+ as described for the `device_has` attribute in Table 180 of the SYCL 2020
228+ specification.
229+
230+ |===
231+
232+ SYCL implementations may introduce additional kernel properties. If any
233+ combinations of kernel attributes are invalid, this must be clearly documented
234+ as part of the new kernel property definition.
235+
236+ === Kernel Properties for the CUDA backend
237+
238+ The kernel properties specified in this section may only be used to decorate
239+ kernels that are submitted to the CUDA backend. Attempting to submit a kernel
240+ with these properties to another backend has undefined behavior.
241+
242+ ```c++
243+ namespace sycl {
244+ namespace ext {
245+ namespace oneapi {
246+ namespace experimental {
247+
248+ struct max_work_group_size_key {
249+ template <size_t... Dims>
250+ using value_t = property_value<max_work_group_size_key, std::integral_constant<size_t, Dims>...>;
251+ }; // max_work_group_size_key
252+
253+ struct max_linear_work_group_size_key {
254+ template <size_t Size>
255+ using value_t = property_value<max_linear_work_group_size_key, std::integral_constant<size_t, Size>>;
256+ }; // max_linear_work_group_size_key
257+
258+ template <size_t... Dims>
259+ inline constexpr max_work_group_size_key::value_t<Dims...> max_work_group_size;
260+
261+ template <size_t Size>
262+ inline constexpr max_linear_work_group_size_key::value_t<Size> max_linear_work_group_size;
263+
264+ template <> struct is_property_key<max_work_group_size_key> : std::true_type {};
265+ template <> struct is_property_key<max_linear_work_group_size_key> : std::true_type {};
266+
267+ } // namespace experimental
268+ } // namespace oneapi
269+ } // namespace ext
270+ } // namespace sycl
271+ ```
272+
273+ |===
274+ |Property|Description
275+
237276|`max_work_group_size`
238277|The `max_work_group_size` property provides a promise to the compiler
239278that the kernel will never be launched with a larger work-group than the
@@ -254,27 +293,8 @@ If the kernel is submitted with an `nd_range` that exceeds the size specified
254293by the property, the implementation must throw a synchronous exception with the
255294`errc::nd_range` error code.
256295
257- |`sub_group_size`
258- |The `sub_group_size` property adds the requirement that the kernel must be
259- compiled and executed with the specified sub-group size. An implementation may
260- throw an exception for certain combinations of property values, devices and
261- launch configurations, as described for the `reqd_sub_group_size` attribute
262- in Table 180 of the SYCL 2020 specification.
263-
264- |`device_has`
265- |The `device_has` property adds the requirement that the kernel must be
266- launched on a device that has all of the aspects listed in the `Aspects`
267- parameter pack. An implementation may throw an exception or issue a
268- diagnostic for certain combinations of aspects, devices and kernel functions,
269- as described for the `device_has` attribute in Table 180 of the SYCL 2020
270- specification.
271-
272296|===
273297
274- SYCL implementations may introduce additional kernel properties. If any
275- combinations of kernel attributes are invalid, this must be clearly documented
276- as part of the new kernel property definition.
277-
278298=== Adding a Property List to a Kernel Launch
279299
280300To enable properties to be associated with kernels, this extension adds
0 commit comments