-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] lazily set context on default constructed events #6296
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
pvchupin
merged 15 commits into
intel:sycl
from
cperkinsintel:lazy-event-context-merged
Jun 28, 2022
Merged
[SYCL] lazily set context on default constructed events #6296
pvchupin
merged 15 commits into
intel:sycl
from
cperkinsintel:lazy-event-context-merged
Jun 28, 2022
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Chris Perkins <[email protected]>
Signed-off-by: Chris Perkins <[email protected]>
…at. can't wait for your next insight.
…e atomic event state. This is undesirable now that we lazily set the context to be the default one (if none is provided). It is also undesirable from a one-function-does-one-thing standpoint. I am introducing a new routine on the impl to change that event state and am adding explicit calls to it where before we were only calling event->setContex I don't like leaking impl state in this way, but it's clean. Right now all the places that are calling setContextImpl are intentionally setting up the event_impl, so having them explicitly set the state is in line with the surrounding activities. Better to have this intention explicit and known rather than hidden and ill understood. Signed-off-by: Chris Perkins <[email protected]>
ping to reviewers. |
…ting. Signed-off-by: Chris Perkins <[email protected]>
Signed-off-by: Chris Perkins <[email protected]>
Signed-off-by: Chris Perkins <[email protected]>
steffenlarsen
approved these changes
Jun 27, 2022
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.
LGTM!
pvchupin
pushed a commit
that referenced
this pull request
Jul 6, 2022
) making host events more explicit. simplifies the logic, makes checking for host (or not) simpler, and reduces potential contention. This is a follow up to #6296 Signed-off-by: Chris Perkins [email protected]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
According to the spec,
sycl::event()
constructed via empty constructor should be initialized with the default context. But simply doing so in that constructor is too expensive - many of those events are created temporarily, never needing the context. So instead, we are adding the context lazily, when it might be needed. The performance impact of both approaches has been measured, the simple direct setting of the context on all empty constructed events is deleterious whereas the method here, setting it lazily, has no appreciable degradation on performance.There are a couple places in the existing codebase where the lack of a context was used as a proxy indicating event state. This has had to change. Also, the
setContextImpl
routine was not only setting the context, but setting the atomic state to incomplete. This is no longer desirable. I've moved the setting of that state to its own call on the impl, and the appropriate calls now invoke it.