@@ -45,7 +45,7 @@ for declaring global variables. One such example is the
45
45
```
46
46
namespace sycl::ext::oneapi {
47
47
48
- template <typename T, typename PropertyListT = property_list <>>
48
+ template <typename T, typename PropertyListT = properties <>>
49
49
class device_global {/*...*/};
50
50
51
51
} // namespace sycl::ext::oneapi
@@ -57,10 +57,7 @@ two compile-time properties:
57
57
```
58
58
using sycl::ext::oneapi;
59
59
60
- device_global<int,
61
- property_list_t<
62
- device_image_scope::value_t,
63
- host_access::value_t<host_access::access::read>>>
60
+ device_global<int, decltype(properties{device_image_scope, host_access_read})>
64
61
dm1;
65
62
```
66
63
@@ -71,7 +68,7 @@ is a list that is created through a template parameter pack expansion:
71
68
```
72
69
namespace sycl::ext::oneapi {
73
70
74
- template <typename T, typename PropertyListT = property_list <>>
71
+ template <typename T, typename PropertyListT = properties <>>
75
72
class device_global {/*...*/};
76
73
77
74
// Partial specialization to make PropertyListT visible as a parameter pack
83
80
Props::meta_name..., Props::meta_value...
84
81
)]]
85
82
#endif
86
- device_global<T, property_list <Props...>> {/*...*/};
83
+ device_global<T, properties <Props...>> {/*...*/};
87
84
88
85
} // namespace sycl::ext::oneapi
89
86
```
@@ -158,7 +155,7 @@ template <typename dataT,
158
155
access::mode accessmode,
159
156
access::target accessTarget,
160
157
access::placeholder isPlaceholder,
161
- typename PropertyListT = ext::oneapi::property_list <>>
158
+ typename PropertyListT = ext::oneapi::properties <>>
162
159
class __attribute__((sycl_special_class)) accessor {/* ... */};
163
160
164
161
} // namespace sycl
@@ -171,7 +168,7 @@ Typical usage would look like this (showing a hypothetical property named
171
168
using sycl;
172
169
using sycl::ext::oneapi;
173
170
174
- accessor acc(buf, cgh, property_list{no_alias_v, foo_v <32>});
171
+ accessor acc(buf, cgh, properties{no_alias, foo <32>});
175
172
```
176
173
177
174
In the headers the C++ attribute
@@ -188,7 +185,7 @@ template <typename dataT,
188
185
access::mode accessmode,
189
186
access::target accessTarget,
190
187
access::placeholder isPlaceholder,
191
- typename PropertyListT = ext::oneapi::property_list <>>
188
+ typename PropertyListT = ext::oneapi::properties <>>
192
189
class __attribute__((sycl_special_class)) accessor {/* ... */};
193
190
194
191
// Partial specialization to make PropertyListT visible as a parameter pack
@@ -204,7 +201,7 @@ class __attribute__((sycl_special_class)) accessor<dataT,
204
201
accessmode,
205
202
accessTarget,
206
203
isPlaceholder,
207
- property_list <Props...>> {
204
+ properties <Props...>> {
208
205
dataT *ptr;
209
206
210
207
#ifdef __SYCL_DEVICE_ONLY__
@@ -269,12 +266,12 @@ the property value to a string if it is not already a string.
269
266
270
267
## Properties on kernel functions
271
268
272
- Compile-time properties can also be used to decorate kernel functions as with
273
- the [ sycl\_ ext\_ oneapi\_ properties] [ 8 ] extension. There are two ways the
274
- application can specify these properties. The first is by passing a
275
- ` property_list ` parameter to the function that submits the kernel:
269
+ Compile-time properties can also be used to decorate kernel functions as
270
+ proposed in the [ sycl\_ ext\_ oneapi\_ kernel \ _ properties] [ 8 ] extension. There
271
+ are two ways the application can specify these properties. The first is by
272
+ passing a ` properties ` parameter to the function that submits the kernel:
276
273
277
- [ 8 ] : < ../extensions/experimental/sycl_ext_oneapi_properties .asciidoc >
274
+ [ 8 ] : < ../extensions/proposed/sycl_ext_oneapi_kernel_properties .asciidoc >
278
275
279
276
```
280
277
namespace sycl {
@@ -295,13 +292,14 @@ using sycl::ext::oneapi;
295
292
296
293
void foo(handler &cgh) {
297
294
cgh.single_task(
298
- property_list{sub_group_size_v <32>, device_has_v <aspect::fp16>},
295
+ properties{sub_group_size <32>, device_has <aspect::fp16>},
299
296
[=] {/* ... */});
300
297
}
301
298
```
302
299
303
300
The second way an application can specify kernel properties is by adding a
304
- ` properties ` member variable to a named kernel function object:
301
+ member function named ` get(sycl::ext::oneapi::properties_tag) ` to a named
302
+ kernel function object:
305
303
306
304
```
307
305
using sycl;
@@ -311,8 +309,9 @@ class MyKernel {
311
309
public:
312
310
void operator()() {/* ... */}
313
311
314
- static constexpr auto properties =
315
- property_list{sub_group_size_v<32>, device_has_v<aspect::fp16>};
312
+ auto get(properties_tag) {
313
+ return properties{sub_group_size<32>, device_has<aspect::fp16>};
314
+ }
316
315
};
317
316
318
317
void foo(handler &cgh) {
@@ -335,7 +334,7 @@ class KernelSingleTaskWrapper;
335
334
// Partial specialization to make PropertyListT visible as a parameter pack
336
335
// of properties.
337
336
template<typename KernelType, typename ...Props>
338
- class KernelSingleTaskWrapper<KernelType, property_list <Props...>> {
337
+ class KernelSingleTaskWrapper<KernelType, properties <Props...>> {
339
338
KernelType k;
340
339
341
340
public:
@@ -379,7 +378,7 @@ class.
379
378
```
380
379
namespace sycl::ext::oneapi {
381
380
382
- template <typename T, typename PropertyListT = property_list_t <>>
381
+ template <typename T, typename PropertyListT = properties <>>
383
382
class annotated_ptr {
384
383
T *ptr;
385
384
public:
@@ -395,11 +394,7 @@ where an example use looks like:
395
394
using sycl::ext::oneapi;
396
395
397
396
void foo(int *p) {
398
- annotated_ptr<int
399
- property_list_t<
400
- foo::value_t,
401
- bar::value_t<32>>>
402
- aptr(p);
397
+ annotated_ptr<int, decltype(properties{foo, bar<32>})> aptr(p);
403
398
}
404
399
```
405
400
@@ -411,13 +406,13 @@ represent the properties.
411
406
```
412
407
namespace sycl::ext::oneapi {
413
408
414
- template <typename T, typename PropertyListT = property_list_t <>>
409
+ template <typename T, typename PropertyListT = properties <>>
415
410
class annotated_ptr;
416
411
417
412
// Partial specialization to make PropertyListT visible as a parameter pack
418
413
// of properties.
419
414
template <typename T, typename ...Props>
420
- class annotated_ptr<T, property_list <Props...>> {
415
+ class annotated_ptr<T, properties <Props...>> {
421
416
T *ptr
422
417
#ifdef __SYCL_DEVICE_ONLY__
423
418
[[__sycl_detail__::add_ir_annotations_member(
@@ -437,13 +432,13 @@ Illustrating this with properties from our previous example:
437
432
```
438
433
namespace sycl::ext::oneapi {
439
434
440
- template <typename T, typename PropertyListT = property_list_t <>>
435
+ template <typename T, typename PropertyListT = properties <>>
441
436
class annotated_ptr;
442
437
443
438
// Partial specialization to make PropertyListT visible as a parameter pack
444
439
// of properties.
445
440
template <typename T, typename ...Props>
446
- class annotated_ptr<T, property_list <Props...>> {
441
+ class annotated_ptr<T, properties <Props...>> {
447
442
T *ptr
448
443
#ifdef __SYCL_DEVICE_ONLY__
449
444
[[__sycl_detail__::add_ir_annotations_member(
@@ -660,7 +655,7 @@ class __attribute__((sycl_special_class)) accessor<dataT,
660
655
accessmode,
661
656
accessTarget,
662
657
isPlaceholder,
663
- property_list <Props...>> {
658
+ properties <Props...>> {
664
659
T *ptr
665
660
#ifdef __SYCL_DEVICE_ONLY__
666
661
[[__sycl_detail__::add_ir_annotations_member(
0 commit comments