@@ -65,7 +65,7 @@ device_global<int,
65
65
```
66
66
67
67
The header file represents these properties with an internal C++ attribute
68
- named ` [[__sycl_detail__::add_ir_global_variable_attributes ()]] ` whose value
68
+ named ` [[__sycl_detail__::add_ir_attributes_global_variable ()]] ` whose value
69
69
is a list that is created through a template parameter pack expansion:
70
70
71
71
```
@@ -79,7 +79,7 @@ class device_global {/*...*/};
79
79
template <typename T, typename ...Props>
80
80
class
81
81
#ifdef __SYCL_DEVICE_ONLY__
82
- [[__sycl_detail__::add_ir_global_variable_attributes (
82
+ [[__sycl_detail__::add_ir_attributes_global_variable (
83
83
Props::meta_name..., Props::meta_value...
84
84
)]]
85
85
#endif
88
88
} // namespace sycl::ext::oneapi
89
89
```
90
90
91
- The ` [[__sycl_detail__::add_ir_global_variable_attributes ()]] ` attribute has an
91
+ The ` [[__sycl_detail__::add_ir_attributes_global_variable ()]] ` attribute has an
92
92
even number of parameters, assuming that the optional "filter list" parameter
93
93
is not specified (see below for a description of this parameter). The first
94
94
half of the parameters are the names of the properties, and the second half of
@@ -102,7 +102,7 @@ namespace sycl::ext::oneapi {
102
102
103
103
template </* ... */> class
104
104
#ifdef __SYCL_DEVICE_ONLY__
105
- [[__sycl_detail__::add_ir_global_variable_attributes (
105
+ [[__sycl_detail__::add_ir_attributes_global_variable (
106
106
"sycl-device-image-scope", // Name of first property
107
107
"sycl-host-access", // Name of second property
108
108
nullptr, // First property has no parameter
@@ -115,7 +115,7 @@ template </* ... */> class
115
115
```
116
116
117
117
The device compiler only uses the
118
- ` [[__sycl_detail__::add_ir_global_variable_attributes ()]] ` attribute when the
118
+ ` [[__sycl_detail__::add_ir_attributes_global_variable ()]] ` attribute when the
119
119
decorated type is used to create an [ LLVM IR global variable] [ 3 ] and the global
120
120
variable's type is either:
121
121
@@ -175,7 +175,7 @@ accessor acc(buf, cgh, property_list{no_alias_v, foo_v<32>});
175
175
```
176
176
177
177
The implementation in the header file is similar to the previous case. The
178
- C++ attribute ` [[__sycl_detail__::add_ir_kernel_parameter_attributes ()]] `
178
+ C++ attribute ` [[__sycl_detail__::add_ir_attributes_kernel_parameter ()]] `
179
179
decorates one of the member variables of the class, and the parameters to this
180
180
attribute represent the properties. As before, the initial parameters are the
181
181
names of the properties and the subsequent parameters are the property values.
@@ -207,7 +207,7 @@ class __attribute__((sycl_special_class)) accessor<dataT,
207
207
property_list<Props...>> {
208
208
dataT *ptr
209
209
#ifdef __SYCL_DEVICE_ONLY__
210
- [[__sycl_detail__::add_ir_kernel_parameter_attributes (
210
+ [[__sycl_detail__::add_ir_attributes_kernel_parameter (
211
211
Props::meta_name..., Props::meta_value...
212
212
)]]
213
213
#endif
@@ -226,7 +226,7 @@ template </* ... */>
226
226
class __attribute__((sycl_special_class)) accessor</* ... */> {
227
227
dataT *ptr
228
228
#ifdef __SYCL_DEVICE_ONLY__
229
- [[__sycl_detail__::add_ir_kernel_parameter_attributes (
229
+ [[__sycl_detail__::add_ir_attributes_kernel_parameter (
230
230
"sycl-no-alias", // Name of first property
231
231
"sycl-foo", // Name of second property
232
232
nullptr, // First property has no parameter
@@ -252,7 +252,7 @@ and it silently ignores the attribute when the class is used in any other way.
252
252
When the front-end creates a kernel argument from a SYCL "special class", it
253
253
passes each member variable of the class as a separate kernel argument. If the
254
254
member variable is decorated with
255
- ` [[__sycl_detail__::add_ir_kernel_parameter_attributes ()]] ` , the front-end adds
255
+ ` [[__sycl_detail__::add_ir_attributes_kernel_parameter ()]] ` , the front-end adds
256
256
one LLVM IR attribute to the kernel function's parameter for each property in
257
257
the list. For example, this can be done by calling
258
258
[ ` Function::addParamAttrs(unsigned ArgNo, const AttrBuilder &) ` ] [ 7 ] . As
@@ -320,7 +320,7 @@ Internally, the header lowers both cases to a wrapper class which defines
320
320
` operator() ` , and that operator function becomes the "top level" kernel
321
321
function that is recognized by the front-end. The definition of this operator
322
322
is decorated with the C++ attribute
323
- ` [[__sycl_detail__::add_ir_function_attributes ()]] ` , and the parameters to this
323
+ ` [[__sycl_detail__::add_ir_attributes_function ()]] ` , and the parameters to this
324
324
attribute represent the properties.
325
325
326
326
```
@@ -338,7 +338,7 @@ class KernelSingleTaskWrapper<KernelType, property_list<Props...>> {
338
338
339
339
#ifdef __SYCL_DEVICE_ONLY__
340
340
__attribute__((sycl_kernel))
341
- [[__sycl_detail__::add_ir_function_attributes (
341
+ [[__sycl_detail__::add_ir_attributes_function (
342
342
Props::meta_name..., Props::meta_value...
343
343
)]]
344
344
#endif
@@ -347,7 +347,7 @@ class KernelSingleTaskWrapper<KernelType, property_list<Props...>> {
347
347
```
348
348
349
349
Although the DPC++ headers only use the
350
- ` [[__sycl_detail__::add_ir_function_attributes ()]] ` attribute on the definition
350
+ ` [[__sycl_detail__::add_ir_attributes_function ()]] ` attribute on the definition
351
351
of a kernel function as shown above, the front-end recognizes it for any
352
352
function definition. The front-end adds one LLVM IR function attribute for
353
353
each property in the list. For example, this can be done by calling
@@ -399,7 +399,7 @@ void foo(int *p) {
399
399
```
400
400
401
401
We again use a C++ attribute to represent the properties in the header. The
402
- attribute ` [[__sycl_detail__::add_ir_member_annotation ()]] ` decorates one of
402
+ attribute ` [[__sycl_detail__::add_ir_annotations_member ()]] ` decorates one of
403
403
the member variables of the class, and the parameters to this attribute
404
404
represent the properties.
405
405
@@ -415,7 +415,7 @@ template <typename T, typename ...Props>
415
415
class annotated_ptr<T, property_list<Props...>> {
416
416
T *ptr
417
417
#ifdef __SYCL_DEVICE_ONLY__
418
- [[__sycl_detail__::add_ir_member_annotation (
418
+ [[__sycl_detail__::add_ir_annotations_member (
419
419
Props::meta_name..., Props::meta_value...
420
420
)]]
421
421
#endif
@@ -441,7 +441,7 @@ template <typename T, typename ...Props>
441
441
class annotated_ptr<T, property_list<Props...>> {
442
442
T *ptr
443
443
#ifdef __SYCL_DEVICE_ONLY__
444
- [[__sycl_detail__::add_ir_member_annotation (
444
+ [[__sycl_detail__::add_ir_annotations_member (
445
445
"sycl-foo", // Name of first property
446
446
"sycl-bar", // Name of second property
447
447
nullptr, // First property has no parameter
@@ -501,7 +501,7 @@ define void @foo(i32* %ptr) {
501
501
```
502
502
503
503
The front-end encodes the properties from the C++ attribute
504
- ` [[__sycl_detail__::add_ir_member_annotation ()]] ` into the
504
+ ` [[__sycl_detail__::add_ir_annotations_member ()]] ` into the
505
505
` @llvm.ptr.annotation ` call as follows:
506
506
507
507
* The first parameter to ` @llvm.ptr.annotation ` is the pointer to annotate (as
@@ -529,10 +529,10 @@ to perform these optimizations.
529
529
As noted above, there are several C++ attributes that convey property names and
530
530
values to the front-end:
531
531
532
- * ` [[__sycl_detail__::add_ir_global_variable_attributes ()]] `
533
- * ` [[__sycl_detail__::add_ir_kernel_parameter_attributes ()]] `
534
- * ` [[__sycl_detail__::add_ir_function_attributes ()]] `
535
- * ` [[__sycl_detail__::add_ir_member_annotation ()]] `
532
+ * ` [[__sycl_detail__::add_ir_attributes_global_variable ()]] `
533
+ * ` [[__sycl_detail__::add_ir_attributes_kernel_parameter ()]] `
534
+ * ` [[__sycl_detail__::add_ir_attributes_function ()]] `
535
+ * ` [[__sycl_detail__::add_ir_annotations_member ()]] `
536
536
537
537
All of these attributes take a parameter list with the same format. There are
538
538
always an even number of parameters, where the first half are the property
@@ -562,9 +562,9 @@ SYCL property has no value the header passes `nullptr`.
562
562
Properties that are implemented using the following C++ attributes are
563
563
represented in LLVM IR as IR attributes:
564
564
565
- * ` [[__sycl_detail__::add_ir_global_variable_attributes ()]] `
566
- * ` [[__sycl_detail__::add_ir_kernel_parameter_attributes ()]] `
567
- * ` [[__sycl_detail__::add_ir_function_attributes ()]] `
565
+ * ` [[__sycl_detail__::add_ir_attributes_global_variable ()]] `
566
+ * ` [[__sycl_detail__::add_ir_attributes_kernel_parameter ()]] `
567
+ * ` [[__sycl_detail__::add_ir_attributes_function ()]] `
568
568
569
569
When the front-end consumes these C++ attributes and produces IR, each property
570
570
name becomes an IR attribute name and each property value becomes the
@@ -591,7 +591,7 @@ types listed above.
591
591
### IR representation via ` @llvm.ptr.annotation `
592
592
593
593
Properties that are implemented using
594
- ` [[__sycl_detail__::add_ir_member_annotation ()]] ` , are represented in LLVM IR
594
+ ` [[__sycl_detail__::add_ir_annotations_member ()]] ` , are represented in LLVM IR
595
595
as the fifth metadata parameter to the ` @llvm.ptr.annotation ` intrinsic
596
596
function. This parameter is a tuple of metadata values with the following
597
597
sequence:
@@ -620,19 +620,19 @@ that the front-end does not generate an IR representation.
620
620
Another case is when a class wants to represent some properties one way in the
621
621
IR while representing other properties in another way. For example, a future
622
622
version of ` accessor ` might pass some properties to
623
- ` [[__sycl_detail__::add_ir_kernel_parameter_attributes ()]] ` while passing other
624
- properties to ` [[__sycl_detail__::add_ir_member_annotation ()]] ` . Again, the
623
+ ` [[__sycl_detail__::add_ir_attributes_kernel_parameter ()]] ` while passing other
624
+ properties to ` [[__sycl_detail__::add_ir_annotations_member ()]] ` . Again, the
625
625
header wants some way to "filter" the properties, such that some properties are
626
626
interpreted as "kernel parameter attributes" while other are interpreted as
627
627
"member annotations".
628
628
629
629
To handle these cases, each of the following C++ attributes takes an optional
630
630
first parameter that is a brace-enclosed list of property names:
631
631
632
- * ` [[__sycl_detail__::add_ir_global_variable_attributes ()]] `
633
- * ` [[__sycl_detail__::add_ir_kernel_parameter_attributes ()]] `
634
- * ` [[__sycl_detail__::add_ir_function_attributes ()]] `
635
- * ` [[__sycl_detail__::add_ir_member_annotation ()]] `
632
+ * ` [[__sycl_detail__::add_ir_attributes_global_variable ()]] `
633
+ * ` [[__sycl_detail__::add_ir_attributes_kernel_parameter ()]] `
634
+ * ` [[__sycl_detail__::add_ir_attributes_function ()]] `
635
+ * ` [[__sycl_detail__::add_ir_annotations_member ()]] `
636
636
637
637
Since this brace-enclosed list acts somewhat like an initializer list, the
638
638
header must include ` <initializer_list> ` prior to passing this optional first
@@ -658,14 +658,14 @@ class __attribute__((sycl_special_class)) accessor<dataT,
658
658
property_list<Props...>> {
659
659
T *ptr
660
660
#ifdef __SYCL_DEVICE_ONLY__
661
- [[__sycl_detail__::add_ir_kernel_parameter_attributes (
661
+ [[__sycl_detail__::add_ir_attributes_kernel_parameter (
662
662
663
663
// The properties in this list are "kernel parameter attributes".
664
664
{"sycl-no-alias", "sycl-foo"},
665
665
666
666
Props::meta_name..., Props::meta_value...
667
667
)]]
668
- [[__sycl_detail__::add_ir_member_annotation (
668
+ [[__sycl_detail__::add_ir_annotations_member (
669
669
670
670
// The properties in this list are "member annotations".
671
671
{"sycl-bar"},
0 commit comments