Skip to content

[NFCI][SYCL] Change scheduler::enqueueCommandForCG to accept event_impl &#19599

Merged
aelovikov-intel merged 1 commit intointel:syclfrom
aelovikov-intel:enqueueCommandForCG
Jul 28, 2025
Merged

[NFCI][SYCL] Change scheduler::enqueueCommandForCG to accept event_impl &#19599
aelovikov-intel merged 1 commit intointel:syclfrom
aelovikov-intel:enqueueCommandForCG

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

}

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.

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