Skip to content

Commit 81fda8c

Browse files
committed
Clarify that range_type attaches to functions
Signed-off-by: John Pennycook <[email protected]>
1 parent 4d248cb commit 81fda8c

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

sycl/doc/extensions/proposed/sycl_ext_oneapi_range_type.asciidoc

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ supports.
9696
feature-test macro always has this value.
9797
|===
9898

99-
=== New kernel property
99+
=== New property
100100

101101
```c++
102102
namespace sycl::ext::oneapi::experimental {
@@ -127,6 +127,27 @@ error code.
127127

128128
|===
129129

130+
This property can also be associated with a device function using the
131+
`SYCL_EXT_ONEAPI_FUNCTION_PROPERTY` macro.
132+
133+
There are special requirements whenever a device function defined in one
134+
translation unit makes a call to a device function that is defined in a second
135+
translation unit.
136+
In such a case, the second device function is always declared using
137+
`SYCL_EXTERNAL`.
138+
If the kernel calling these device functions is defined using a `range_type`
139+
property, the functions declared using `SYCL_EXTERNAL` must be similarly
140+
decorated to ensure that a compatible `range_type` is used.
141+
This decoration must exist in both the translation unit making the call and
142+
also in the translation unit that defines the function.
143+
If the `range_type` property is missing in the translation unit that makes the
144+
call, or if the `range_type` of the called function is not compatible with the
145+
`range_type` of the calling function, the program is ill-formed and the
146+
compiler must raise a diagnostic.
147+
Two `range_type` properties are considered compatible if all values that can be
148+
represented by the `range_type` of the caller function can be represented by
149+
the `range_type` of the called function.
150+
130151
== Usage example
131152

132153
```c++

0 commit comments

Comments
 (0)