From f94848f54c318fc33baaca231f34e368374f8b97 Mon Sep 17 00:00:00 2001 From: Ben Tracy Date: Mon, 6 May 2024 18:55:29 +0100 Subject: [PATCH] [SYCL][Graph] Add wording about arbitrary C++ code in CGFs --- .../experimental/sycl_ext_oneapi_graph.asciidoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sycl/doc/extensions/experimental/sycl_ext_oneapi_graph.asciidoc b/sycl/doc/extensions/experimental/sycl_ext_oneapi_graph.asciidoc index e28e7cdd51cad..be345cb60ec89 100644 --- a/sycl/doc/extensions/experimental/sycl_ext_oneapi_graph.asciidoc +++ b/sycl/doc/extensions/experimental/sycl_ext_oneapi_graph.asciidoc @@ -1593,6 +1593,19 @@ As a result, users don't need to manually wrap queue recording code in a back to the executing state. Instead, an uncaught exception destroying the modifiable graph will perform this action, useful in RAII pattern usage. +=== Command-Group Function Limitations + +While not disallowed by the SYCL specification it should be noted that it is not +possible to capture arbitrary C++ code which is inside a CGF (Command-Group +Function) used to create a graph node. This code will be evaluated once during +the call to `queue::submit()` or `command_graph::add()` along with the calls to +handler functions and this will not be reflected on future executions of the +graph. + +Any code like this should be moved to a separate host-task and added to the +graph via the recording or explicit APIs in order to be compatible with this +extension. + === Host Tasks :host-task: https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#subsec:interfaces.hosttasks