@@ -425,23 +425,20 @@ Exceptions:
425425template <int Dimensions>
426426void update_nd_range(nd_range<Dimensions> executionRange);
427427----
428- | Updates the ND-Range for this node with a new value. This new value will not
428+ | Updates the ND-range for this node with a new value. This new value will not
429429affect any executable graphs this node is part of until it is passed to the
430430executable graph's update function.
431431See <<executable-graph-update, Executable Graph Update>> for more information
432432about updating kernel nodes.
433433
434434Parameters:
435435
436- * `executionRange` - The new value for the ND-Range .
436+ * `executionRange` - The new value for the ND-range .
437437
438438Exceptions:
439439
440440* Throws with error code `invalid` if `Dimensions` does not match the dimensions
441- of the nd_range the kernel was originally created with.
442-
443- * Throws with error code `invalid` if the kernel node was originally created
444- with a `sycl::range`.
441+ of the existing kernel execution range.
445442
446443* Throws with error code `invalid` if the type of the node is not a kernel
447444 execution.
@@ -452,23 +449,20 @@ Exceptions:
452449template <int Dimensions>
453450void update_range(range<Dimensions> executionRange);
454451----
455- | Updates the execution Range for this node with a new value. This new value
452+ | Updates the execution range for this node with a new value. This new value
456453will not affect any executable graphs this node is part of until it is
457454passed to the executable graph's update function.
458455See <<executable-graph-update, Executable Graph Update>> for more information
459456about updating kernel nodes.
460457
461458Parameters:
462459
463- * `executionRange` - The new value for the Range .
460+ * `executionRange` - The new value for the range .
464461
465462Exceptions:
466463
467464* Throws with error code `invalid` if `Dimensions` does not match the dimensions
468- of the range the kernel was originally created with.
469-
470- * Throws with error code `invalid` if the kernel node was originally created
471- with a `sycl::nd_range`.
465+ of the existing kernel execution range.
472466
473467* Throws with error code `invalid` if the type of the node is not a kernel
474468 execution.
@@ -523,7 +517,7 @@ Table {counter: tableNumber}. Member functions of the `dynamic_parameter` class.
523517|
524518[source,c++]
525519----
526- dynamic_parameter(command_graph<graph_state::modifiable> graph,
520+ dynamic_parameter(command_graph<graph_state::modifiable> graph,
527521 const ValueT &initialValue);
528522----
529523|Constructs a dynamic parameter object that can be registered with command graph
@@ -564,10 +558,10 @@ namespace ext::oneapi::experimental {
564558class dynamic_command_group {
565559public:
566560 dynamic_command_group(
567- command_graph<graph_state::modifiable> graph,
561+ command_graph<graph_state::modifiable> & graph,
568562 const std::vector<std::function<void(handler &)>>& cgfList);
569563
570- size_t get_active_cgf();
564+ size_t get_active_cgf() const ;
571565 void set_active_cgf(size_t cgfIndex);
572566};
573567----
@@ -579,6 +573,8 @@ as active. When a dynamic command-group node is executed, the kernel of the acti
579573command-group function will be run and all the other command-group functions in
580574`cgfList` will be ignored.
581575
576+ The `dynamic_command_group` class provides the {crs}[common reference semantics].
577+
582578See <<executable-graph-update, Executable Graph Update>> for more information
583579about updating command-groups.
584580
@@ -591,7 +587,8 @@ All the command-group functions in a dynamic command-group must have identical d
591587It is not allowed for a dynamic command-group to have command-group functions that would
592588result in a change to the graph topology when set to active. In practice, this means that
593589any calls to `handler.depends_on()` must be identical for all the command-group functions
594- in a dynamic command-group.
590+ in a dynamic command-group. The dependencies created by buffer accessors must also create
591+ identical node dependencies across all of the command-group functions.
595592
596593Table {counter: tableNumber}. Member functions of the `dynamic_command_group` class.
597594[cols="2a,a"]
@@ -602,7 +599,7 @@ Table {counter: tableNumber}. Member functions of the `dynamic_command_group` cl
602599[source,c++]
603600----
604601dynamic_command_group(
605- command_graph<graph_state::modifiable> graph,
602+ command_graph<graph_state::modifiable> & graph,
606603const std::vector<std::function<void(handler &)>>& cgfList);
607604----
608605
@@ -618,21 +615,19 @@ Exceptions:
618615
619616* Throws synchronously with error code `invalid` if the graph wasn't created with
620617 the `property::graph::assume_buffer_outlives_graph` property and the `dynamic_command_group`
621- is created with command-group functions that use buffers. See the
618+ is created with any command-group function that uses buffers. See the
622619 <<assume-buffer-outlives-graph-property, Assume-Buffer-Outlives-Graph>>
623620 property for more information.
624621
625622* Throws with error code `invalid` if the `dynamic_command_group` is created with
626623 command-group functions that are not kernel executions.
627624
628- * Throws with error code `invalid` if the command-group functions in `cgfList` have
629- event dependencies that are incompatible with each other and would result in
630- different graph topologies when set to active.
625+ * Throws with error code `invalid` if `cgfList` is empty.
631626
632627|
633628[source,c++]
634629----
635- size_t get_active_cgf();
630+ size_t get_active_cgf() const ;
636631----
637632|Returns the index of the currently active command-group function in this
638633`dynamic_command_group`.
@@ -844,9 +839,9 @@ The aspects of a kernel execution node that can be changed during update are
844839different depending on the API used to perform the update:
845840
846841* For the <<individual-node-update, Individual Node Update>> API it's possible to update
847- the kernel function, the parameters to the kernel, and the ND-Range .
842+ the kernel function, the parameters to the kernel, and the ND-range .
848843* For the <<whole-graph-update, Whole Graph Update>> API, only the parameters of the kernel
849- and the ND-Range can be updated.
844+ and the ND-range can be updated.
850845
851846===== Individual Node Update [[individual-node-update]]
852847
@@ -889,7 +884,11 @@ kernel, this can be set through `node::update_nd_range()` or
889884`node::update_range()` but does not require any prior registration.
890885
891886An alternative way to update the execution range of a node is to do so while
892- updating command groups as described in the next section.
887+ updating command groups as described in the next section. Using this mechanism
888+ lifts the restriction from `node::update_nd_range()` / `node::update_range()`
889+ of only being to update the execution range in the same dimension. As the
890+ update being tied to a change in command-group means that the updated kernel
891+ code may be defined as operating in a different dimension.
893892
894893====== Command Group Updates
895894
@@ -909,6 +908,14 @@ dynamic parameters can be used in command-group functions that are part of
909908dynamic command-groups. Updates to such dynamic parameters will be reflected
910909in the command-group functions once they are activated.
911910
911+ Note that the execution range is tied to the command-group, therefore updating
912+ the range of a node which uses a dynamic command-group shared by another node
913+ will also update the execution range of the nodes sharing the dynamic
914+ command-group. Activating a command-group with `set_active_cgf` to a
915+ command-group that previously had its execution range updated with
916+ `node::update_range()` or `node::update_nd_range()` will not reset the execution
917+ range to the original, but instead use the most recently updated value.
918+
912919====== Committing Updates
913920
914921Updating a node using the methods mentioned above will take effect immediately
@@ -1230,6 +1237,14 @@ Exceptions:
12301237
12311238* Throws synchronously with error code `invalid` if a queue is recording
12321239 commands to the graph.
1240+
1241+ * Throws synchronously with error code `invalid` if the graph does not match
1242+ the graph used on construction of `dynamicCG`.
1243+
1244+ * Throws with error code `invalid` if the command-group functions in `cgfList` have
1245+ event or accessor dependencies that are incompatible with each other and
1246+ would result in different graph topologies when set to active.
1247+
12331248|
12341249[source,c++]
12351250----
@@ -2381,8 +2396,8 @@ if used in application code.
23812396
23822397. Using reductions in a graph node.
23832398. Using sycl streams in a graph node.
2384- . Synchronization between multiple executions of the same command-buffer
2385- must be handled in the host for level-zero backend, which may involve
2399+ . Synchronization between multiple executions of the same command-buffer
2400+ must be handled in the host for level-zero backend, which may involve
23862401 extra latency for subsequent submissions.
23872402
23882403== Revision History
0 commit comments