forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 3
[SYCL] Add explicit update API to graph spec #77
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
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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_memory_parameter(const T& from, const T& to); | ||
}; | ||
} // namespace ext::oneapi::experimental | ||
|
||
|
@@ -466,6 +468,12 @@ 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 buffer and USM parameters to the executable graph can also be updated | ||
using the `command_graph::update_memory_parameter()` method. This can be useful | ||
if only a small number of inputs & outputs require updating. It is not possible | ||
to update scalar parameters as they are considered to be captured by value in | ||
command group scope, so due to the copy there is no basis for a comparison. | ||
|
||
==== Graph Member Functions | ||
|
||
Table 5. Constructor of the `command_graph` class. | ||
|
@@ -844,6 +852,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_memory_parameter(const T& from, const T& to); | ||
---- | ||
|
||
|Updates a memory 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. | ||
|
||
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`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.