Skip to content

Commit

Permalink
[SYCL] Update wording around updating kernel/host code
Browse files Browse the repository at this point in the history
- Make modifying kernel or host code in update undefined behaviour.
  • Loading branch information
Bensuo committed Jul 4, 2023
1 parent d3ed070 commit 1b79ebc
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions sycl/doc/extensions/proposed/sycl_ext_oneapi_graph.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,8 @@ void
update(const command_graph<graph_state::modifiable>& graph);
----

:sycl-kernel-function: https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#sycl-kernel-function

|Updates the executable graph node inputs & outputs from a topologically
identical modifiable graph. A topologically identical graph is one with the
same structure of nodes and edges, and the nodes added in the same order to
Expand All @@ -872,17 +874,16 @@ to update an executable graph, every node in the graph must be either a kernel
command or a host-task.

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

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

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

The effects of the update will be visible on the next submission of the
executable graph without the need for additional user synchronization.
Expand Down

0 comments on commit 1b79ebc

Please sign in to comment.