-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add experimental extension for counter-based events #221
Conversation
Resolves: oneapi-src#145 Signed-off-by: Jaime Arteaga <[email protected]>
I think you should add more details about usage restrictions |
scripts/core/counterbasedevent.yml
Outdated
etors: | ||
- name: IMMEDIATE | ||
desc: "Counter-based event is used for immediate command lists (default)" | ||
- name: NON_REGULAR |
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.
do you mean NON_IMMEDIATE here?
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.
thanks @MichalMrozek . Fixed.
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.
do we need two flags? say if we just have IMMEDIATE, then the absence of that flag would mean REGULAR cmdlists?
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.
thanks @aravindksg . I was thinking on that. However, it is better to be explicit. in any case, as you see, we are saying that default value is zero, which is IMMEDAITE, so the user only needs to pass a flag (NON_REGULAR) if they want for regular.
type: $x_event_counter_based_exp_flags_t
name: flags
desc: |
[in] mode flags.
must be 0 (default)
Signed-off-by: Jaime Arteaga <[email protected]>
@MichalMrozek , @BartoszDunajski : please take a look at latest changes. |
Signed-off-by: Jaime Arteaga <[email protected]>
scripts/core/counterbasedevent.yml
Outdated
desc: "Counter-based event is used for non-immediate command lists" | ||
--- #-------------------------------------------------------------------------- | ||
type: struct | ||
desc: "Event descriptor for counter-based events. This structure may be passed to $xEventCreate as pNext member of $x_event_desc_t." |
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.
do we want to consider adding flag for event pools for counter based events? i.e, would there be value in creating an event pool where events from that pool are only used as counting events?
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.
Yes we need flag for event memory pool as those events doesn't require pool memory to be allocated for them, the storage is inherited from command list.
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.
@MichalMrozek : sorry, could you clarify the comment about event pool? do we want the counter-based flags to be part of the zeEventPoolCreate or zeEventCreate, or both?
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.
Counter Based Events doesn't need memory backing if they are for immediate command lists, so this must be event pool flag as this is steered to control where allocation happens.
I do not see a need for event flag.
So only change in zeEventPoolCreate flags.
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.
seems to me that we are talking about "counter events" being associated at a command queue level. so would it be better to describe a different struct for this entirely so we can cleanly associate at command queue/command list level rather than shoe-horning it into existing event(pool) struct/desc?
we have fences described here as being associated at command queue level, so something similar for "counter events"?
https://spec.oneapi.io/level-zero/latest/core/PROG.html#fences
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.
We want to leverage events, otherwise all append API's would need to be rewritten.
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.
thanks @MichalMrozek . I have moved the flags to the event pool logic. Please check.
Signed-off-by: Jaime Arteaga <[email protected]>
@MichalMrozek , @aravindksg, @BartoszDunajski : please see latest changes. |
07f477f
to
016e895
Compare
i.e., a signaled counter-based event always represents the completion of the last call to which it was passed as signal event. | ||
- Synchronizing on a counter-based event waits only the last saved counter value from the last command list that incremented it. | ||
- A counter-based event may be passed as signaling event for a new append call without needing to wait for the signaling of | ||
the last call where it was used. |
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.
do we want to add notes on effect of "Timestamp" flags with counter events? I think timestamp flags (even if set) would be ignored right? or we want to forbid user from setting it and return error?
also- do we expect IPC events to continue to work with counter events?
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.
timestamps and IPC are orthogonal features, I dont think they cannot work, However, if that's the case, we can add note in the documentation in future follow ups.
Signed-off-by: Jaime Arteaga <[email protected]>
016e895
to
9e911ed
Compare
Signed-off-by: Jaime Arteaga <[email protected]>
In general looks ok. But usage on Regular CmdLists is not well described here. This is something that may be confusing in the future and its worth to explain it. Counter assigned to Event is updated on Each "execute" call. For example:
CLs executed again:
|
thanks @BartoszDunajski . Let me add that clarification in a follow-up patch. |
Resolves: #145