Skip to content

Commit 9ebc7d5

Browse files
authored
[SYCL] Update wording around updating kernel/host code (#248)
- Make modifying kernel or host code in update undefined behaviour. - Use host task consistently in spec
1 parent d3ed070 commit 9ebc7d5

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

sycl/doc/extensions/proposed/sycl_ext_oneapi_graph.asciidoc

+13-11
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,8 @@ Exceptions:
851851

852852
|===
853853

854+
:sycl-kernel-function: https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#sycl-kernel-function
855+
854856
Table {counter: tableNumber}. Member functions of the `command_graph` class (executable graph update).
855857
[cols="2a,a"]
856858
|===
@@ -863,26 +865,26 @@ void
863865
update(const command_graph<graph_state::modifiable>& graph);
864866
----
865867

868+
866869
|Updates the executable graph node inputs & outputs from a topologically
867870
identical modifiable graph. A topologically identical graph is one with the
868871
same structure of nodes and edges, and the nodes added in the same order to
869872
both graphs. Equivalent nodes in topologically identical graphs each have the
870873
same command, targeting the same device. There is the additional limitation that
871874
to update an executable graph, every node in the graph must be either a kernel
872-
command or a host-task.
875+
command or a host task.
873876

874877
The only characteristics that can differ between two topologically identical
875-
graphs during an update are:
878+
graphs during an update are the arguments to kernel nodes. For example,
879+
the graph may capture different values for the USM pointers or accessors used
880+
in the graph. It is these kernels arguments in `graph` that constitute the
881+
inputs & outputs to update to.
876882

877-
* The arguments to kernel nodes may be different between graphs. For example,
878-
the graph may capture different values for the USM pointers or accessors used
879-
in the graph. It is these kernels arguments in `graph` that constitute the
880-
inputs & outputs to update to.
883+
Differences in the following characteristics between two graphs during an
884+
update results in undefined behavior:
881885

882-
* The code that is executed in host-task nodes may be different between graphs,
883-
and the update will reflect the code from `graph` host-tasks nodes. However,
884-
any changes to executable code between kernel nodes are not counted as
885-
topologically identical and is an exception with error code `invalid`.
886+
* Modifying the native C++ callable of a `host task` node.
887+
* Modifying the {sycl-kernel-function}[kernel function] of a kernel node.
886888

887889
The effects of the update will be visible on the next submission of the
888890
executable graph without the need for additional user synchronization.
@@ -907,7 +909,7 @@ Exceptions:
907909
:handler-copy-functions: https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#table.members.handler.copy
908910

909911
* Throws synchronously with error code `invalid` if `graph` contains any node
910-
which is not a kernel command or host-task, e.g.
912+
which is not a kernel command or host task, e.g.
911913
{handler-copy-functions}[memory operations].
912914

913915
* Throws synchronously with error code `invalid` if the context or device

0 commit comments

Comments
 (0)