-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Cache and reuse events in the Level Zero plugin. #6484
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
Conversation
Event->Context->addZeEventToCache(Event->ZeEvent, Event->ZeEventPool, | ||
Event->isHostVisible(), | ||
Event->isProfilingEnabled()); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, thanks, fixed.
Avoid creating new Level Zero events. Reset native event handles and put them in the cache instead of removing.
8935550
to
95d1584
Compare
CUDA backend failures are unrelated. |
@@ -276,6 +276,8 @@ template <class T> struct ZeCache : private T { | |||
struct ReferenceCounter { | |||
ReferenceCounter(pi_uint32 InitVal) : RefCount{InitVal} {} | |||
|
|||
void reset(pi_uint32 InitVal) { RefCount = InitVal; } |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Avoid creating new pi_event objects. Reset pi_event objects
and put them in the cache instead of removing.