Skip to content
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

Move urInit into piPluginInit #12

Merged
merged 1 commit into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion sycl/plugins/unified_runtime/pi2ur.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,12 +452,19 @@ mapPIMetadataToUR(const pi_device_binary_property *pi_metadata,

namespace pi2ur {


inline pi_result piPluginInit() {

HANDLE_ERRORS(urInit(0));
return PI_SUCCESS;
}

inline pi_result piTearDown(void *PluginParameter) {
std::ignore = PluginParameter;
// TODO: Dont check for errors in urTearDown, since
// when using Level Zero plugin, the second urTearDown
// will fail as ur_loader.so has already been unloaded,
urTearDown(nullptr);
HANDLE_ERRORS(urTearDown(nullptr));
return PI_SUCCESS;
}

Expand Down
3 changes: 2 additions & 1 deletion sycl/plugins/unified_runtime/pi_unified_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,8 @@ __SYCL_EXPORT pi_result piPluginInit(pi_plugin *PluginInit) {
_PI_API(piextPluginGetOpaqueData)
_PI_API(piTearDown)

return PI_SUCCESS;
return pi2ur::piPluginInit();

}

} // extern "C