diff --git a/sycl/doc/extensions/experimental/sycl_ext_oneapi_graph.asciidoc b/sycl/doc/extensions/experimental/sycl_ext_oneapi_graph.asciidoc index f51d3b503d78a..b9bff2d226c09 100644 --- a/sycl/doc/extensions/experimental/sycl_ext_oneapi_graph.asciidoc +++ b/sycl/doc/extensions/experimental/sycl_ext_oneapi_graph.asciidoc @@ -1842,6 +1842,19 @@ for(int i = 0 ; i < Iterations, i++) { } ---- +[source,c++] +---- +// Explicit API usage snippet + +// Add an external event node to Graph A +auto ExtEventNode = GraphA.add_external_event(); + +... + +// Add a wait external event node in GraphB +auto ExtWaitNode = GraphB.add_wait_external_event({ExtEventNode.get_external_event()}); +---- + ==== Normal SYCL Events Normal SYCL events from queue submissions outside of a `command_graph` may be @@ -1851,6 +1864,29 @@ passed to `handler::depends_on()` for nodes added explicitly to a operations that do not need to run on every graph execution but must be executed before the main graph commands, such as warm-ups or initialization. +[source,c++] +---- + +// Normal submission to a queue +auto NormalEvent = Queue.submit(...); + +Graph.begin_recording(Queue); + +auto GraphEvent = Queue.submit([&](handler& CGH){ + // OK! This node will depend on NormalEvent + CGH.depends_on(NormalEvent); + CGH.parallel_for(...); +}); + +Graph.end_recording(Queue); + +auto ExecGraph = Graph.finalize(); + +// The node associated with GraphEvent will be correctly ordered with respect to +// NormalEvent +Queue.ext_oneapi_graph(ExecGraph); +---- + === Thread Safety The new functions in this extension are thread-safe, the same as member