Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL] Add explicit update API to graph spec #77

Closed
wants to merge 4 commits into from
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions sycl/doc/extensions/proposed/sycl_ext_oneapi_graph.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ class command_graph<graph_state::executable> {
public:
command_graph() = delete;
void update(const command_graph<graph_state::modifiable>& graph);
template <typename T>
void update_parameter(const T& from, const T& to);
};
} // namespace ext::oneapi::experimental

Expand Down Expand Up @@ -466,6 +468,10 @@ outputs of the modifiable graph, a technique called _Whole Graph Update_. The
modifiable graph must have the same topology as the graph originally used to
create the executable graphs, with the nodes added in the same order.

Individual input parameters to the executable graph can also be updated
using the `command_graph::update_parameter()` method. This can be useful
if only a small number of parameters require updating.

==== Graph Member Functions

Table 5. Constructor of the `command_graph` class.
Expand Down Expand Up @@ -844,6 +850,35 @@ Exceptions:
* Throws synchronously with error code `invalid` if the topology of `graph` is
not the same as the existing graph topology, or if the nodes were not added in
the same order.

|
[source, c++]
----
using namespace ext::oneapi::experimental;
template <typename T>
void command_graph<graph_state::executable>
update_parameter(const T& from, const T& to);
----

|Updates a parameter across the executable graph such that all nodes in the
graph which use `from` as a parameter will have that parameter replaced by
`to`.

Preconditions:

* This member function is only available when the `command_graph` state is
`graph_state::executable`.
* T must be either a buffer or a raw pointer to a USM allocation.
Bensuo marked this conversation as resolved.
Show resolved Hide resolved

Parameters:

* `from` - The parameter within the graph to be updated.
* `to` - The new value to use for this parameter.

Exceptions:

* Throws synchronously with error code `invalid` if `from` is not found within the graph
or if `to` is not compatible with `from`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to specify what incompatible entails here? I feel like this statement is very generic.

|===

=== Queue Class Modifications
Expand Down