Skip to content

Commit 9ad4651

Browse files
committed
Rename C++ attributes
1 parent 403e6c9 commit 9ad4651

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

sycl/doc/CompileTimeProperties.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ device_global<int,
6565
```
6666

6767
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
6969
is a list that is created through a template parameter pack expansion:
7070

7171
```
@@ -79,7 +79,7 @@ class device_global {/*...*/};
7979
template <typename T, typename ...Props>
8080
class
8181
#ifdef __SYCL_DEVICE_ONLY__
82-
[[__sycl_detail__::add_ir_global_variable_attributes(
82+
[[__sycl_detail__::add_ir_attributes_global_variable(
8383
Props::meta_name..., Props::meta_value...
8484
)]]
8585
#endif
@@ -88,7 +88,7 @@ class
8888
} // namespace sycl::ext::oneapi
8989
```
9090

91-
The `[[__sycl_detail__::add_ir_global_variable_attributes()]]` attribute has an
91+
The `[[__sycl_detail__::add_ir_attributes_global_variable()]]` attribute has an
9292
even number of parameters, assuming that the optional "filter list" parameter
9393
is not specified (see below for a description of this parameter). The first
9494
half of the parameters are the names of the properties, and the second half of
@@ -102,7 +102,7 @@ namespace sycl::ext::oneapi {
102102
103103
template </* ... */> class
104104
#ifdef __SYCL_DEVICE_ONLY__
105-
[[__sycl_detail__::add_ir_global_variable_attributes(
105+
[[__sycl_detail__::add_ir_attributes_global_variable(
106106
"sycl-device-image-scope", // Name of first property
107107
"sycl-host-access", // Name of second property
108108
nullptr, // First property has no parameter
@@ -115,7 +115,7 @@ template </* ... */> class
115115
```
116116

117117
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
119119
decorated type is used to create an [LLVM IR global variable][3] and the global
120120
variable's type is either:
121121

@@ -175,7 +175,7 @@ accessor acc(buf, cgh, property_list{no_alias_v, foo_v<32>});
175175
```
176176

177177
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()]]`
179179
decorates one of the member variables of the class, and the parameters to this
180180
attribute represent the properties. As before, the initial parameters are the
181181
names of the properties and the subsequent parameters are the property values.
@@ -207,7 +207,7 @@ class __attribute__((sycl_special_class)) accessor<dataT,
207207
property_list<Props...>> {
208208
dataT *ptr
209209
#ifdef __SYCL_DEVICE_ONLY__
210-
[[__sycl_detail__::add_ir_kernel_parameter_attributes(
210+
[[__sycl_detail__::add_ir_attributes_kernel_parameter(
211211
Props::meta_name..., Props::meta_value...
212212
)]]
213213
#endif
@@ -226,7 +226,7 @@ template </* ... */>
226226
class __attribute__((sycl_special_class)) accessor</* ... */> {
227227
dataT *ptr
228228
#ifdef __SYCL_DEVICE_ONLY__
229-
[[__sycl_detail__::add_ir_kernel_parameter_attributes(
229+
[[__sycl_detail__::add_ir_attributes_kernel_parameter(
230230
"sycl-no-alias", // Name of first property
231231
"sycl-foo", // Name of second property
232232
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.
252252
When the front-end creates a kernel argument from a SYCL "special class", it
253253
passes each member variable of the class as a separate kernel argument. If the
254254
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
256256
one LLVM IR attribute to the kernel function's parameter for each property in
257257
the list. For example, this can be done by calling
258258
[`Function::addParamAttrs(unsigned ArgNo, const AttrBuilder &)`][7]. As
@@ -320,7 +320,7 @@ Internally, the header lowers both cases to a wrapper class which defines
320320
`operator()`, and that operator function becomes the "top level" kernel
321321
function that is recognized by the front-end. The definition of this operator
322322
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
324324
attribute represent the properties.
325325

326326
```
@@ -338,7 +338,7 @@ class KernelSingleTaskWrapper<KernelType, property_list<Props...>> {
338338
339339
#ifdef __SYCL_DEVICE_ONLY__
340340
__attribute__((sycl_kernel))
341-
[[__sycl_detail__::add_ir_function_attributes(
341+
[[__sycl_detail__::add_ir_attributes_function(
342342
Props::meta_name..., Props::meta_value...
343343
)]]
344344
#endif
@@ -347,7 +347,7 @@ class KernelSingleTaskWrapper<KernelType, property_list<Props...>> {
347347
```
348348

349349
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
351351
of a kernel function as shown above, the front-end recognizes it for any
352352
function definition. The front-end adds one LLVM IR function attribute for
353353
each property in the list. For example, this can be done by calling
@@ -399,7 +399,7 @@ void foo(int *p) {
399399
```
400400

401401
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
403403
the member variables of the class, and the parameters to this attribute
404404
represent the properties.
405405

@@ -415,7 +415,7 @@ template <typename T, typename ...Props>
415415
class annotated_ptr<T, property_list<Props...>> {
416416
T *ptr
417417
#ifdef __SYCL_DEVICE_ONLY__
418-
[[__sycl_detail__::add_ir_member_annotation(
418+
[[__sycl_detail__::add_ir_annotations_member(
419419
Props::meta_name..., Props::meta_value...
420420
)]]
421421
#endif
@@ -441,7 +441,7 @@ template <typename T, typename ...Props>
441441
class annotated_ptr<T, property_list<Props...>> {
442442
T *ptr
443443
#ifdef __SYCL_DEVICE_ONLY__
444-
[[__sycl_detail__::add_ir_member_annotation(
444+
[[__sycl_detail__::add_ir_annotations_member(
445445
"sycl-foo", // Name of first property
446446
"sycl-bar", // Name of second property
447447
nullptr, // First property has no parameter
@@ -501,7 +501,7 @@ define void @foo(i32* %ptr) {
501501
```
502502

503503
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
505505
`@llvm.ptr.annotation` call as follows:
506506

507507
* The first parameter to `@llvm.ptr.annotation` is the pointer to annotate (as
@@ -529,10 +529,10 @@ to perform these optimizations.
529529
As noted above, there are several C++ attributes that convey property names and
530530
values to the front-end:
531531

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()]]`
536536

537537
All of these attributes take a parameter list with the same format. There are
538538
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`.
562562
Properties that are implemented using the following C++ attributes are
563563
represented in LLVM IR as IR attributes:
564564

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()]]`
568568

569569
When the front-end consumes these C++ attributes and produces IR, each property
570570
name becomes an IR attribute name and each property value becomes the
@@ -591,7 +591,7 @@ types listed above.
591591
### IR representation via `@llvm.ptr.annotation`
592592

593593
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
595595
as the fifth metadata parameter to the `@llvm.ptr.annotation` intrinsic
596596
function. This parameter is a tuple of metadata values with the following
597597
sequence:
@@ -620,19 +620,19 @@ that the front-end does not generate an IR representation.
620620
Another case is when a class wants to represent some properties one way in the
621621
IR while representing other properties in another way. For example, a future
622622
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
625625
header wants some way to "filter" the properties, such that some properties are
626626
interpreted as "kernel parameter attributes" while other are interpreted as
627627
"member annotations".
628628

629629
To handle these cases, each of the following C++ attributes takes an optional
630630
first parameter that is a brace-enclosed list of property names:
631631

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()]]`
636636

637637
Since this brace-enclosed list acts somewhat like an initializer list, the
638638
header must include `<initializer_list>` prior to passing this optional first
@@ -658,14 +658,14 @@ class __attribute__((sycl_special_class)) accessor<dataT,
658658
property_list<Props...>> {
659659
T *ptr
660660
#ifdef __SYCL_DEVICE_ONLY__
661-
[[__sycl_detail__::add_ir_kernel_parameter_attributes(
661+
[[__sycl_detail__::add_ir_attributes_kernel_parameter(
662662
663663
// The properties in this list are "kernel parameter attributes".
664664
{"sycl-no-alias", "sycl-foo"},
665665
666666
Props::meta_name..., Props::meta_value...
667667
)]]
668-
[[__sycl_detail__::add_ir_member_annotation(
668+
[[__sycl_detail__::add_ir_annotations_member(
669669
670670
// The properties in this list are "member annotations".
671671
{"sycl-bar"},

0 commit comments

Comments
 (0)