-
Notifications
You must be signed in to change notification settings - Fork 116
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
[L0] Interrupt-based event implementation #2334
base: main
Are you sure you want to change the base?
[L0] Interrupt-based event implementation #2334
Conversation
4af82e7
to
b063947
Compare
To expose this functionality in UR, we want two ways of enabling low-power events: Queue-wide enabling so all events created on the queue are low-powered. As a property passed to urEnqueueEventsWaitWithBarrier making the resulting event a low-power event. This will require the existing interface to be extended with properties, potentially through a new experimental function. Signed-off-by: Zhang, Winston <[email protected]>
Signed-off-by: Zhang, Winston <[email protected]>
Signed-off-by: Zhang, Winston <[email protected]>
7835bc8
to
28e7d38
Compare
Signed-off-by: Zhang, Winston <[email protected]>
Signed-off-by: Zhang, Winston <[email protected]>
Signed-off-by: Zhang, Winston <[email protected]>
bool InterruptBased = | ||
EnqueueExtProp && | ||
(EnqueueExtProp->flags & UR_EXP_ENQUEUE_EXT_FLAG_LOW_POWER_EVENTS); | ||
if (InterruptBased) { |
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'm not sure I understand the intention here or why we need to cast the function.
ur_queue_handle_t, uint32_t, const ur_event_handle_t *, | ||
ur_event_handle_t *, bool)>(EnqueueEventsWaitWithBarrier)( | ||
Queue, NumEventsInWaitList, EventWaitList, OutEvent, | ||
Queue ? Queue->InterruptBasedEventsEnabled : false); |
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.
Queue ? Queue->InterruptBasedEventsEnabled : false
I don't believe Queue can be null here. So this should be simply InterruptBased || Queue->InterruptBasedEventsEnabled
.
@@ -574,6 +583,9 @@ ur_event_handle_t ur_context_handle_t_::getEventFromContextCache( | |||
if (Event->CounterBasedEventsEnabled != CounterBasedEventEnabled) { | |||
return nullptr; | |||
} | |||
if (Event->InterruptBasedEventsEnabled != InterruptBasedEventEnabled) { |
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 will not work unless the interrupt based events are somehow first on the Cache container. The same is true of the counter-based events. There needs to be separate pool for interrupt-driven events (or maybe they shouldn't be cached at all?).
HostVisibleInterruptAndCounterBasedRegularCacheType, | ||
HostInvisibleInterruptAndCounterBasedRegularCacheType, | ||
HostVisibleInterruptAndCounterBasedImmediateCacheType, | ||
HostInvisibleInterruptAndCounterBasedImmediateCacheType |
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 exactly why I've asked you to do the refactor. This will grow exponentially with new event parameters.
To expose this functionality in UR, we want two ways of enabling low-power events: