-
Notifications
You must be signed in to change notification settings - Fork 124
Implement adapter instance handles #715
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
Conversation
I've updated the tests but there are still CI failures. I'll look into those, but the actual spec and loader changes should be ok so feedback is still welcome |
desc: "[in][range(0, NumAdapters)] array of adapters to query for platforms." | ||
- type: "uint32_t" | ||
name: "NumAdapters" | ||
desc: "[in] number of adapters pointed to by phAdapters" |
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.
Feels odd to be passing in all the adapters here as a list, its a different approach to urDeviceGet
only taking a single platform. I can see why this is a less intrusive way to do it though.
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.
Yeah, I did it this way to keep the changes as unobtrusive as possible, especially since urPlatformGet
is in pretty much every example and test.
It also means fewer changes in the loader, which already had a special case for urPlatformGet
where it looped over every adapter in the loader context. This PR just changes that to the adapters passed in.
If consistency with the other entry points is important I could look into changing this.
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 don't think its a blocker for this work but perhaps something to look into at a later point.
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.
Made a note to revisit this in #728
65bcfac
to
a9c2bef
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.
In a separate PR we might also want to update urInit
and urTearDown
documentation.
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
201a30d
to
80a1340
Compare
80a1340
to
903b6af
Compare
903b6af
to
b279985
Compare
Bump the Unified Runtime commit, and make adapter changes needed for the newly added adapter handles (see oneapi-src/unified-runtime#715 for details) This fixes #10066 by providing an implementation of `piPluginGetLastError` in pi2ur.
Bump the Unified Runtime commit, and make adapter changes needed for the newly added adapter handles (see oneapi-src/unified-runtime#715 for details) This fixes intel#10066 by providing an implementation of `piPluginGetLastError` in pi2ur.
Bump the Unified Runtime commit, and make adapter changes needed for the newly added adapter handles (see oneapi-src/unified-runtime#715 for details) This fixes intel#10066 by providing an implementation of `piPluginGetLastError` in pi2ur.
Bump the Unified Runtime commit, and make adapter changes needed for the newly added adapter handles (see oneapi-src#715 for details) This fixes #10066 by providing an implementation of `piPluginGetLastError` in pi2ur.
Bump the Unified Runtime commit, and make adapter changes needed for the newly added adapter handles (see #715 for details) This fixes #10066 by providing an implementation of `piPluginGetLastError` in pi2ur.
Bump the Unified Runtime commit, and make adapter changes needed for the newly added adapter handles (see oneapi-src/unified-runtime#715 for details) This fixes intel#10066 by providing an implementation of `piPluginGetLastError` in pi2ur.
Bump the Unified Runtime commit, and make adapter changes needed for the newly added adapter handles (see oneapi-src#715 for details) This fixes #10066 by providing an implementation of `piPluginGetLastError` in pi2ur.
Bump the Unified Runtime commit, and make adapter changes needed for the newly added adapter handles (see oneapi-src/unified-runtime#715 for details) This fixes intel#10066 by providing an implementation of `piPluginGetLastError` in pi2ur.
Bump the Unified Runtime commit, and make adapter changes needed for the newly added adapter handles (see oneapi-src#715 for details) This fixes #10066 by providing an implementation of `piPluginGetLastError` in pi2ur.
Bump the Unified Runtime commit, and make adapter changes needed for the newly added adapter handles (see oneapi-src#715 for details) This fixes #10066 by providing an implementation of `piPluginGetLastError` in pi2ur.
Bump the Unified Runtime commit, and make adapter changes needed for the newly added adapter handles (see oneapi-src#715 for details) This fixes #10066 by providing an implementation of `piPluginGetLastError` in pi2ur.
Bump the Unified Runtime commit, and make adapter changes needed for the newly added adapter handles (see oneapi-src#715 for details) This fixes #10066 by providing an implementation of `piPluginGetLastError` in pi2ur.
Corresponding changes to the adapters, pi2ur, etc are in intel/llvm#10349
Summary of new/changed entry points:
ur_adapter_handle_t
should be a single static object in the adapter.UR_PLATFORM_BACKEND
).Addresses #714 by allowing better sharing of UR adapters when multiple modules in an application share the UR libraries. They may independently call
urAdapterGet
safely, or may explicitly pass adapter handles around (retaining/releasing as necessary).Provides some more programmatic control over which adapters are used by allowing users to query which backend is supported by each adapter, and only fetching platforms from certain adapters.
Fixes intel/llvm#10066 by allowing
piPluginGetLastError
to be implementable in pi2ur.