Skip to content

Commit 403e6c9

Browse files
committed
Clarify wording about C++ attributes
Clarify the description about the changes to the header file to state exactly which C++ attribute is added.
1 parent cf06694 commit 403e6c9

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

sycl/doc/CompileTimeProperties.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,11 @@ using sycl::ext::oneapi;
174174
accessor acc(buf, cgh, property_list{no_alias_v, foo_v<32>});
175175
```
176176

177-
As before, the header file represents the properties with an internal C++
178-
attribute, where the initial parameters are the names of the properties and
179-
the subsequent parameters are the property values. However, this time the
180-
attribute decorates one of the member variables.
177+
The implementation in the header file is similar to the previous case. The
178+
C++ attribute `[[__sycl_detail__::add_ir_kernel_parameter_attributes()]]`
179+
decorates one of the member variables of the class, and the parameters to this
180+
attribute represent the properties. As before, the initial parameters are the
181+
names of the properties and the subsequent parameters are the property values.
181182

182183
```
183184
namespace sycl {
@@ -315,9 +316,12 @@ void foo(handler &cgh) {
315316
}
316317
```
317318

318-
Internally, the headers lower both cases to a wrapper class that expresses the
319-
properties as an internal C++ attribute, and the `operator()` of this class
320-
becomes the "top level" kernel function that is recognized by the front-end.
319+
Internally, the header lowers both cases to a wrapper class which defines
320+
`operator()`, and that operator function becomes the "top level" kernel
321+
function that is recognized by the front-end. The definition of this operator
322+
is decorated with the C++ attribute
323+
`[[__sycl_detail__::add_ir_function_attributes()]]`, and the parameters to this
324+
attribute represent the properties.
321325

322326
```
323327
template<typename KernelType, typename PropertyListT>
@@ -394,8 +398,10 @@ void foo(int *p) {
394398
}
395399
```
396400

397-
We again implement the property list in the header via a C++ attribute, where
398-
the attribute decorates a member variable of the class:
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
403+
the member variables of the class, and the parameters to this attribute
404+
represent the properties.
399405

400406
```
401407
namespace sycl::ext::oneapi {

0 commit comments

Comments
 (0)