Skip to content

Commit

Permalink
Add example and address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiomestre committed Jul 4, 2024
1 parent 488916b commit 528b14c
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions sycl/doc/extensions/experimental/sycl_ext_oneapi_graph.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1453,17 +1453,38 @@ graph LR
Recording -->|End Recording| Executing
....

==== Implicit Queue Recording
==== Transitive Queue Recording

Submitting a command-group to a queue can implicitly change its state
to `queue_state::recording`. This will occur when the command-group depends on
an event that has been returned by a queue in the recording state.
Submitting a command-group to a queue in the executable state can implicitly
change its state to `queue_state::recording`. This will occur when the
command-group depends on an event that has been returned by a queue in the
recording state. The change of state happens before the command-group is
submitted (i.e. a new graph node will be created for that command-group).

A queue whose state has been set to `queue_state::recording` using this
mechanism, will behave as if it had been passed as an argument to
`command_graph::begin_recording()`. In particular, its state will not
change again until `command_graph::end_recording()` is called.

===== Example

[source,c++]
----
// q1 state is set to recording.
graph.begin_recording(q1);
// Node is added to the graph by submitting to a recording queue.
auto e1 = q1.single_task(...);
// Since there is a dependency on e1 which was created by a queue being
// recorded, q2 immediately enters record mode, and a new node is created
// with an edge between e1 and e2.
auto e2 = q2.single_task(e1, ...);
// Ends recording on q1 and q2.
graph.end_recording();
----

==== Queue Properties;

:queue-properties: https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#sec:queue-properties
Expand Down

0 comments on commit 528b14c

Please sign in to comment.