-
Notifications
You must be signed in to change notification settings - Fork 796
[NFCI][SYCL] Change scheduler::enqueueCommandForCG
to accept event_impl &
#19599
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
[NFCI][SYCL] Change scheduler::enqueueCommandForCG
to accept event_impl &
#19599
Conversation
…_impl &` Before this PR, its implementation had code paths for `nullptr` argument, but it's never `nullptr` at any of the call sites. Originally, this method was added in intel#7531 and was called with `nullptr` argument from some fusion code (at least), but it doesn't seem to be the case anymore (and fusion support has been removed from the project). Also, for some reason it was accepting `std::shared_ptr<event_impl>` by value and not by reference (no idea why), and the name was `NewEvent` without any comments/documentation. The former is irrelevant after this change, and for the latter I'm changing the name to a neutral "Event". If someone has a better understanding, please let me know.
@@ -285,7 +285,7 @@ Command::getUrEventsBlocking(const std::vector<EventImplPtr> &EventImpls, | |||
!EventImpl->getCommand()->producesPiEvent()) | |||
continue; | |||
std::vector<Command *> AuxCmds; | |||
Scheduler::getInstance().enqueueCommandForCG(EventImpl, AuxCmds, | |||
Scheduler::getInstance().enqueueCommandForCG(*EventImpl, AuxCmds, |
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.
Known non-null due to dereference in line 283.
@@ -144,31 +144,29 @@ EventImplPtr Scheduler::addCG( | |||
} | |||
} | |||
|
|||
enqueueCommandForCG(NewEvent, AuxiliaryCmds); | |||
enqueueCommandForCG(*NewEvent, AuxiliaryCmds); |
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.
Known non-null due to dereference at line 136. Closing }
at line 145 is from the lock guard scope, so we do go through line 135 before making this call.
if (NewEvent) { | ||
NewEvent->setCommand(nullptr); | ||
} | ||
Event.setCommand(nullptr); | ||
delete NewCmd; |
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.
This delete
is just bizarre, the ownership model is totally unclear here. Irrelevant to this PR though.
Before this PR, its implementation had code paths for
nullptr
argument, but it's nevernullptr
at any of the call sites. Originally, this method was added in #7531 and was called withnullptr
argument from some fusion code (at least), but it doesn't seem to be the case anymore (and fusion support has been removed from the project).Also, for some reason it was accepting
std::shared_ptr<event_impl>
by value and not by reference (no idea why), and the name wasNewEvent
without any comments/documentation. The former is irrelevant after this change, and for the latter I'm changing the name to a neutral "Event". If someone has a better understanding, please let me know.