Skip to content

[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

Merged
merged 1 commit into from
Jul 28, 2025

Conversation

aelovikov-intel
Copy link
Contributor

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 #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.

…_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,
Copy link
Contributor Author

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);
Copy link
Contributor Author

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;
Copy link
Contributor Author

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.

@aelovikov-intel aelovikov-intel merged commit c01b093 into intel:sycl Jul 28, 2025
25 checks passed
@aelovikov-intel aelovikov-intel deleted the enqueueCommandForCG branch July 28, 2025 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants