Skip to content

[NFC][SYCL] Pass queue_impl by raw ptr/ref in event_impl.hpp #18983

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Jun 16, 2025

Conversation

aelovikov-intel
Copy link
Contributor

Part of the ongoing refactoring to prefer raw ptr/ref for SYCL RT objects by default with explicit shared_from_this when lifetimes need to be extended.

Part of the ongoing refactoring to prefer raw ptr/ref for SYCL RT
objects by default with explicit `shared_from_this` when lifetimes need
to be extended.
@aelovikov-intel aelovikov-intel requested a review from a team as a code owner June 13, 2025 23:38
std::weak_ptr<queue_impl> Queue = isHost() ? MSubmittedQueue : MQueue;
if (QueueImplPtr QueuePtr = Queue.lock()) {
device_impl &Device = QueuePtr->getDeviceImpl();
if (auto Queue = isHost() ? MSubmittedQueue.lock() : MQueue.lock()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be uniform with changes above, plus avoids creation of a weak_ptr copy (which has some overhead: https://godbolt.org/z/YErne5446).

@@ -323,13 +323,6 @@ bool Command::isFusable() const {
}
#endif // __INTEL_PREVIEW_BREAKING_CHANGES

static void flushCrossQueueDeps(const std::vector<EventImplPtr> &EventImpls,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to be a member function of Command

@aelovikov-intel aelovikov-intel force-pushed the queue_impl-event_impl branch from 2cfc087 to 118a184 Compare June 16, 2025 17:18
@aelovikov-intel aelovikov-intel removed request for a team and EwanC June 16, 2025 17:18
aelovikov-intel added a commit to aelovikov-intel/llvm that referenced this pull request Jun 16, 2025
aelovikov-intel added a commit to aelovikov-intel/llvm that referenced this pull request Jun 16, 2025
aelovikov-intel added a commit to aelovikov-intel/llvm that referenced this pull request Jun 16, 2025
aelovikov-intel added a commit to aelovikov-intel/llvm that referenced this pull request Jun 16, 2025
@aelovikov-intel aelovikov-intel merged commit 1eb75c7 into intel:sycl Jun 16, 2025
25 checks passed
@aelovikov-intel aelovikov-intel deleted the queue_impl-event_impl branch June 16, 2025 22:20
aelovikov-intel added a commit that referenced this pull request Jun 17, 2025
aelovikov-intel added a commit to aelovikov-intel/llvm that referenced this pull request Jun 17, 2025
aelovikov-intel added a commit that referenced this pull request Jun 17, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants