@@ -811,16 +811,6 @@ the host application interact with device globals defined in runtime-compiled
811
811
code. Device globals are only supported for the `source_language::sycl`
812
812
language.
813
813
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
-
824
814
[source,c++]
825
815
----
826
816
namespace sycl {
@@ -856,8 +846,7 @@ _Returns:_ The value `true` only if
856
846
857
847
* the kernel bundle was created from a bundle of state
858
848
`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`.
861
850
862
851
a|
863
852
[frame=all,grid=none]
@@ -885,8 +874,8 @@ _Throws:_
885
874
886
875
* An `exception` with the `errc::invalid` error code if
887
876
`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`.
890
879
* An `exception` with the `errc::memory_allocation` error code if the allocation
891
880
or initialization of the device global's storage fails.
892
881
@@ -1127,6 +1116,12 @@ However, we don't yet have a utility library where this would go, and it may be
1127
1116
hard for customers to discover this functionality if it is defined outside of
1128
1117
this extension.
1129
1118
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
+
1130
1125
== Non-normative implementation notes for {dpcpp}
1131
1126
1132
1127
=== 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
1148
1143
kernels using external libraries. Note that for the second and fourth form,
1149
1144
`dir` is a separate element in the `build_options` list.
1150
1145
|===
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 ab `exception` with the
1158
+ `errc::invalid` error code.
0 commit comments