Skip to content

Commit 10aa1c8

Browse files
committed
[SYCL][Doc][RTC] Add device global queries to kernel_compiler extension
Signed-off-by: Julian Oppermann <[email protected]>
1 parent 83632e3 commit 10aa1c8

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

sycl/doc/extensions/experimental/sycl_ext_oneapi_kernel_compiler.asciidoc

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -811,16 +811,6 @@ the host application interact with device globals defined in runtime-compiled
811811
code. Device globals are only supported for the `source_language::sycl`
812812
language.
813813

814-
This extension currently supports only a subset of the
815-
link:../experimental/sycl_ext_oneapi_device_global.asciidoc[
816-
sycl_ext_oneapi_device_global] extension:
817-
818-
* Device globals must be declared at global scope.
819-
* Device globals declared with the `device_image_scope` property can be used in
820-
the runtime-compiled device code, but cannot be accessed from the host.
821-
822-
We plan to lift both limitations in a future version of this extension.
823-
824814
[source,c++]
825815
----
826816
namespace sycl {
@@ -856,8 +846,7 @@ _Returns:_ The value `true` only if
856846

857847
* the kernel bundle was created from a bundle of state
858848
`bundle_state::ext_oneapi_source` in the language `source_language::sycl`, and
859-
* it defines a device global whose name is `name` and which was declared without
860-
the `device_image_scope` property.
849+
* it defines a device global whose name is `name`.
861850

862851
a|
863852
[frame=all,grid=none]
@@ -885,8 +874,8 @@ _Throws:_
885874

886875
* An `exception` with the `errc::invalid` error code if
887876
`ext_oneapi_has_device_global(name)` returns `false`.
888-
* An `exception` with the `errc::invalid` error code if the context associated
889-
with this bundle does not contain device `dev`.
877+
* An `exception` with the `errc::invalid` error code if the bundle was not built
878+
for device `dev`.
890879
* An `exception` with the `errc::memory_allocation` error code if the allocation
891880
or initialization of the device global's storage fails.
892881

@@ -1127,6 +1116,12 @@ However, we don't yet have a utility library where this would go, and it may be
11271116
hard for customers to discover this functionality if it is defined outside of
11281117
this extension.
11291118

1119+
* The specification of the _name_ of a device global needs to be refined. If
1120+
device globals declared in namespaces or as static class member should be
1121+
supported, we have to extend the `registered_names` property to also accept
1122+
their qualified source code names. Should device globals declared at global
1123+
scope be registered implicitly, similar to `extern "C"` kernels?
1124+
11301125
== Non-normative implementation notes for {dpcpp}
11311126

11321127
=== Supported `build_options` when the language is `sycl`
@@ -1148,3 +1143,16 @@ files when the language is ``sycl``"). This is useful, for example, to compile
11481143
kernels using external libraries. Note that for the second and fourth form,
11491144
`dir` is a separate element in the `build_options` list.
11501145
|===
1146+
1147+
=== Limitations
1148+
1149+
==== Device globals
1150+
1151+
* Device globals must be declared at global scope. Device globals declared in a
1152+
namespace or as a static class member will be reported as not being present in
1153+
the kernel bundle.
1154+
* Device globals declared with the `device_image_scope` property can be used in
1155+
the runtime-compiled device code, but cannot be accessed from the host.
1156+
Calling `kernel_bundle::ext_oneapi_get_device_global_address` for a device
1157+
global with `device_image_scope` will throw an `exception` with the
1158+
`errc::invalid` error code.

0 commit comments

Comments
 (0)