Skip to content

Commit 6d00902

Browse files
committed
Drop device parameter; editorial changes
Signed-off-by: Julian Oppermann <[email protected]>
1 parent b146027 commit 6d00902

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

sycl/doc/extensions/experimental/sycl_ext_oneapi_kernel_compiler.asciidoc

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -823,11 +823,10 @@ template <bundle_state State>
823823
class kernel_bundle {
824824
// Continued from "New kernel bundle member functions"
825825
826-
bool ext_oneapi_has_device_global(const std::string &name, const device &dev);
826+
bool ext_oneapi_has_device_global(const std::string &name);
827827
void *ext_oneapi_get_device_global_address(const std::string &name,
828828
const device &dev);
829-
size_t ext_oneapi_get_device_global_size(const std::string &name,
830-
const device &dev);
829+
size_t ext_oneapi_get_device_global_size(const std::string &name);
831830
};
832831
833832
} // namespace sycl
@@ -840,7 +839,7 @@ a|
840839
a!
841840
[source,c++]
842841
----
843-
bool ext_oneapi_has_device_global(const std::string &name, const device &dev)
842+
bool ext_oneapi_has_device_global(const std::string &name)
844843
----
845844
!====
846845

@@ -852,8 +851,7 @@ _Returns:_ The value `true` only if
852851
* the kernel bundle was created from a bundle of state
853852
`bundle_state::ext_oneapi_source` in the language `source_language::sycl`, and
854853
* it defines a device global whose name is `name` and which was declared without
855-
the `device_image_scope` property, and
856-
* `dev` is contained by the context associated with this bundle.
854+
the `device_image_scope` property.
857855

858856
`name` must be a {cpp} identifier that is valid for referencing the device
859857
global at the bottom of the source code.
@@ -872,16 +870,20 @@ void *ext_oneapi_get_device_global_address(const std::string &name,
872870
_Constraints:_ This function is not available when `State` is
873871
`bundle_state::ext_oneapi_source`.
874872

875-
_Effects:_ If device memory for `name` has not been allocated at the time of
876-
this call, it will be allocated and zero-initialized synchronously.
873+
_Returns:_ A device USM pointer to the storage for the device global `name` on
874+
device `dev`.
877875

878-
_Returns:_ Returns a USM pointer to the device global `name`'s storage on device
879-
`dev`.
876+
_Remarks:_ The contents of the device global may be read or written from the
877+
host by reading from or writing to this address. If the address is read before
878+
any kernel writes to the device global, the read operation returns the device
879+
global's initial value.
880880

881881
_Throws:_
882882

883883
* An `exception` with the `errc::invalid` error code if
884-
`ext_oneapi_has_device_global(name, dev)` returns `false`.
884+
`ext_oneapi_has_device_global(name)` returns `false`.
885+
* An `exception` with the `errc::invalid` error code if the context associated
886+
with this bundle does not contain device `dev`.
885887
* An `exception` with the `errc::memory_allocation` error code if the allocation
886888
or initialization of the device global's storage fails.
887889

@@ -891,20 +893,19 @@ a|
891893
a!
892894
[source,c++]
893895
----
894-
size_t ext_oneapi_get_device_global_size(const std::string &name,
895-
const device &dev)
896+
size_t ext_oneapi_get_device_global_size(const std::string &name)
896897
----
897898
!====
898899

899900
_Constraints:_ This function is not available when `State` is
900901
`bundle_state::ext_oneapi_source`.
901902

902-
_Returns:_ Returns the size in bytes of device global `name`.
903+
_Returns:_ The size in bytes of the USM storage for device global `name`.
903904

904905
_Throws:_
905906

906907
* An `exception` with the `errc::invalid` error code if
907-
`ext_oneapi_has_device_global(name, dev)` returns `false`.
908+
`ext_oneapi_has_device_global(name)` returns `false`.
908909
|====
909910

910911

@@ -1080,8 +1081,7 @@ int main() {
10801081
float scale = 0.1f;
10811082
void *scale_addr =
10821083
kb_exe.ext_oneapi_get_device_global_address("scale", q.get_device());
1083-
size_t scale_size =
1084-
kb_exe.ext_oneapi_get_device_global_size("scale", q.get_device());
1084+
size_t scale_size = kb_exe.ext_oneapi_get_device_global_size("scale");
10851085
q.memcpy(scale_addr, &scale, scale_size).wait();
10861086
10871087
// Get the kernel via its compiler-generated name, and launch it as before.

0 commit comments

Comments
 (0)