Skip to content

Conversation

@againull
Copy link
Contributor

@againull againull commented Jul 27, 2022

Avoid creating new pi_event objects. Reset pi_event objects
and put them in the cache instead of removing.

@againull againull requested a review from a team as a code owner July 27, 2022 17:34
@againull againull requested a review from smaslov-intel July 28, 2022 05:24
Comment on lines 5867 to 5869
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we maybe cache the PI event instead of re-creating from L0 components?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call, thanks, fixed.

againull added 2 commits July 28, 2022 11:20
Avoid creating new Level Zero events. Reset native event
handles and put them in the cache instead of removing.
@againull againull force-pushed the events_reuse_general_case branch from 8935550 to 95d1584 Compare July 28, 2022 18:45
@againull againull requested a review from smaslov-intel July 28, 2022 19:00
@againull againull changed the title [SYCL] Reuse native event handles in the Level Zero plugin. [SYCL] Cache and reuse events in the Level Zero plugin. Jul 28, 2022
@againull
Copy link
Contributor Author

CUDA backend failures are unrelated.

struct ReferenceCounter {
ReferenceCounter(pi_uint32 InitVal) : RefCount{InitVal} {}

void reset(pi_uint32 InitVal) { RefCount = InitVal; }
Copy link
Contributor

Choose a reason for hiding this comment

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

this is strange that it takes an arbitrary integer (I think you only call it with "1")
why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, fixed.

Hardcode initial value to 1 because ReferenceCounter is used only for ref
counting pi_objects where initial value is always 1.
@againull againull requested a review from smaslov-intel August 1, 2022 18:14
@againull againull merged commit a41b33c into intel:sycl Aug 2, 2022
@againull againull deleted the events_reuse_general_case branch December 3, 2022 00:11
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.

2 participants