-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix adding empty nodes to the graph results in two root nodes #237
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just some minor comments!
auto EventImpl = std::make_shared<detail::event_impl>(); | ||
|
||
// Extract relevant data from the handler and pass to graph to create a | ||
// new node representing this command group. | ||
std::shared_ptr<ext::oneapi::experimental::detail::node_impl> NodeImpl = | ||
GraphImpl->add(CGData.MEvents); | ||
QueueGraph->add(CGData.MEvents); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewing this code, I'm wondering if empty nodes will work with in-order queues for record & replay because we don't reach the code on lines 428-443.
Created #239 to investigate this, as it shouldn't hold up this PR
Co-authored-by: Ewan Crawford <ewan@codeplay.com>
Fix adding empty nodes to the graph results in two root nodes
Fixes an issue revealed in
CommandGraphTest.AddNode
where an empty node without dependencies would lead to two root nodes being added to the graph. The first is added in the special Graph case inhandler::finalize()
and the second ingraph_impl::add(const std::vector<std::shared_ptr<node_impl>> &Dep)
. This patch adds a node inhandler::finalize()
only during queue recording. Explicitly added empty nodes use a new command group with none-type and follow the regular kernelgraph_impl::add
path.isEmpty()
is extended to include command groups with none-type.This supersedes #236 which lacked support for record and replay mode.