-
Notifications
You must be signed in to change notification settings - Fork 790
[NFC][SYCL][Graph] Introduce nodes_range
utility
#19295
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,7 +147,7 @@ class graph_impl : public std::enable_shared_from_this<graph_impl> { | |
/// @return Created node in the graph. | ||
std::shared_ptr<node_impl> add(node_type NodeType, | ||
std::shared_ptr<sycl::detail::CG> CommandGroup, | ||
std::vector<std::shared_ptr<node_impl>> &Deps); | ||
nodes_range Deps); | ||
|
||
/// Create a CGF node in the graph. | ||
/// @param CGF Command-group function to create node with. | ||
|
@@ -161,7 +161,7 @@ class graph_impl : public std::enable_shared_from_this<graph_impl> { | |
/// Create an empty node in the graph. | ||
/// @param Deps List of predecessor nodes. | ||
/// @return Created node in the graph. | ||
std::shared_ptr<node_impl> add(std::vector<std::shared_ptr<node_impl>> &Deps); | ||
std::shared_ptr<node_impl> add(nodes_range Deps); | ||
|
||
/// Create an empty node in the graph. | ||
/// @param Events List of events associated to this node. | ||
|
@@ -174,8 +174,7 @@ class graph_impl : public std::enable_shared_from_this<graph_impl> { | |
/// @param Deps List of predecessor nodes. | ||
/// @return Created node in the graph. | ||
std::shared_ptr<node_impl> | ||
add(std::shared_ptr<dynamic_command_group_impl> &DynCGImpl, | ||
std::vector<std::shared_ptr<node_impl>> &Deps); | ||
add(std::shared_ptr<dynamic_command_group_impl> &DynCGImpl, nodes_range Deps); | ||
|
||
/// Add a queue to the set of queues which are currently recording to this | ||
/// graph. | ||
|
@@ -542,14 +541,12 @@ class graph_impl : public std::enable_shared_from_this<graph_impl> { | |
/// added as a root node. | ||
/// @param Node The node to add deps for | ||
/// @param Deps List of dependent nodes | ||
void addDepsToNode(const std::shared_ptr<node_impl> &Node, | ||
std::vector<std::shared_ptr<node_impl>> &Deps) { | ||
if (!Deps.empty()) { | ||
for (auto &N : Deps) { | ||
N->registerSuccessor(Node); | ||
this->removeRoot(Node); | ||
} | ||
} else { | ||
void addDepsToNode(const std::shared_ptr<node_impl> &Node, nodes_range Deps) { | ||
for (node_impl &N : Deps) { | ||
N.registerSuccessor(Node); | ||
this->removeRoot(Node); | ||
} | ||
if (Node->MPredecessors.empty()) { | ||
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. IMO, the "root" invariant should be handled completely automatically between However, I've changed 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. That refactor of how root nodes gets recording makes, sense but agree that's for a separate patch. |
||
this->addRoot(Node); | ||
} | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.