-
Notifications
You must be signed in to change notification settings - Fork 112
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] move platform cache into the adapter structure #1252
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1252 +/- ##
=======================================
Coverage 15.80% 15.80%
=======================================
Files 223 223
Lines 31483 31483
Branches 3558 3558
=======================================
Hits 4975 4975
Misses 26457 26457
Partials 51 51 ☔ View full report in Codecov by Sentry. |
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
6f4c425
to
d35ea94
Compare
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 for the level-zero changes, thank you!
The ur.hpp and ur.cpp files were moved to the unified runtime repo. This is currently blocking #12403, oneapi-src/unified-runtime#1252.
The platform cache is a global variable used exclusively by the L0 adapter, and it's protected by a loosely-associated spin lock. However, its destruction is associated with the lifetime of the adapter structure and is deleted the first time adapter refcount reaches 0. This was causing issues whenever the adapter was initialized and destroyed multiple time inside of a single process, which, for example, happens during tests. This patch fixes the above problem by moving the platform cache from the global state into the adapter structure. This allows for a simpler implementation that no longer requires an explicit lock and instead uses lazy loading (std::call_once). With this patch, all platform tests are now passing for L0. Closes oneapi-src#824
d35ea94
to
c56b44e
Compare
This solves the same issues as intel#12432, but for urDeviceCreateWithNativeHandle. Includes required oneapi-src/unified-runtime#1252
[L0] move platform cache into the adapter structure
[L0] move platform cache into the adapter structure
[L0] move platform cache into the adapter structure
The platform cache is a global variable used exclusively by the L0 adapter, and it's protected by a loosely-associated spin lock. However, its destruction is associated with the lifetime of the adapter structure and is deleted the first time adapter refcount reaches 0. This was causing issues whenever the adapter was initialized and destroyed multiple time inside of a single process, which, for example, happens during tests.
This patch fixes the above problem by moving the platform cache from the global state into the adapter structure. This allows for a simpler implementation that no longer requires an explicit lock and instead uses lazy loading (std::call_once).
With this patch, all platform tests are now passing for L0. Closes #824