Skip to content

[SYCL] Optimize urEnqueueEventsWaitWithBarrier for in-order queues #10995

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 4 commits into from
Aug 31, 2023

Conversation

againull
Copy link
Contributor

Don't insert zeCommandListAppendWaitOnEvents/zeCommandListAppendSignalEvent for queue::ext_oneapi_submit_barrier() if we have in-order queue and all events in the waitlist are from the same queue.

Don't insert zeCommandListAppendWaitOnEvents/zeCommandListAppendSignalEvent
for queue::ext_oneapi_submit_barrier() if we have in-order queue and all
events in the waitlist are from the same queue.
@againull againull requested review from a team as code owners August 29, 2023 01:46
if (!EventWaitList.Length)
return true;

auto Queue = EventWaitList.UrEventList[0]->UrQueue;
Copy link
Contributor

Choose a reason for hiding this comment

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

is this the same queue from the original scope, in line 169 below? if so, maybe we can just pass it to the lambda?

is that the same queue from the original scope?

 

if (Queue->isInOrderQueue() &&
            EmptyOrAllEventsFromSameQueue(EventWaitList) &&
            Queue->LastCommandEvent && !Queue->LastCommandEvent->IsDiscarded) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

// For in-order queue and wait-list which is empty or has events from
// the same queue just use the last command event as the barrier event.
if (Queue->isInOrderQueue() &&
EmptyOrAllEventsFromSameQueue(EventWaitList) &&
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you need to pass queue, as this can only be optimized if events on waitlist have the same que as LastCommandEvent, if events are coming from other queue , even though it is the same, the Last Event wouldn't represent proper status as we need to wait on those.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I agree, fixed.

@againull againull requested a review from jandres742 August 30, 2023 16:02
@againull
Copy link
Contributor Author

@sergey-semenov Friendly ping.

@againull againull merged commit 499b4bf into intel:sycl Aug 31, 2023
veselypeta pushed a commit to veselypeta/llvm that referenced this pull request Sep 21, 2023
…ntel#10995)

Don't insert
zeCommandListAppendWaitOnEvents/zeCommandListAppendSignalEvent for
queue::ext_oneapi_submit_barrier() if we have in-order queue and all
events in the waitlist are from the same queue.
@againull againull deleted the optimize_barriers branch December 22, 2023 04:20
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.

4 participants