Skip to content

[UR][L0] Init/deinit L0 adapter on first/last use #19089

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

Open
wants to merge 2 commits into
base: sycl
Choose a base branch
from

Conversation

RossBrunton
Copy link
Contributor

Instead of using a global constructor to initialize the L0 adapter,
do it in the first call to urAdapterGet. Likewise, instead of
de-initing it as a global destructor, do it in the last call to
urAdapterRelease.

As well as not doing L0 initialization where the user is not using
L0, it also allows urAdapterRelease to be called in a global
destructor (e.g. what the SYCL runtime does) without worrying
about global destructor order.

Instead of using a global constructor to initialize the L0 adapter,
do it in the first call to `urAdapterGet`. Likewise, instead of
de-initing it as a global destructor, do it in the last call to
`urAdapterRelease`.

As well as not doing L0 initialization where the user is not using
L0, it also allows `urAdapterRelease` to be called in a global
destructor (e.g. what the SYCL runtime does) without worrying
about global destructor order.
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