Skip to content

[UR] call urGetAdapter before creating a device from native handle #12631

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

Closed
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
17 changes: 8 additions & 9 deletions sycl/plugins/unified_runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,14 @@ endif()
if(SYCL_PI_UR_USE_FETCH_CONTENT)
include(FetchContent)

set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
# commit c0b1f13d94966090a1bb982b3bd747b30b9ef9d3
# Merge: 475ce8b4 cf806c37
# Author: aarongreig <[email protected]>
# Date: Mon Feb 5 13:41:50 2024 +0000
# Merge pull request #1240 from cppchedy/chedy/fix-bi-copy-image
#
# [Bindless][exp] 1D Image copy fix
set(UNIFIED_RUNTIME_TAG c0b1f13d94966090a1bb982b3bd747b30b9ef9d3)
set(UNIFIED_RUNTIME_REPO "https://github.com/pbalcer/unified-runtime.git")
# commit d216eb44d5c9fe3433eecdd09b10e3e79ac25bd7
# Merge: 40517d2b fc1f3066
# Author: Kenneth Benzie (Benie) <[email protected]>
# Date: Wed Jan 31 10:38:07 2024 +0000
# Merge pull request #1226 from hdelan/get-native-mem-on-device2
# [UR] Add extra param to urMemGetNativeHandle
set(UNIFIED_RUNTIME_TAG c56b44e7efd084617df349dbf49ce14b00aa8c11)

if(SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO)
set(UNIFIED_RUNTIME_REPO "${SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO}")
Expand Down
6 changes: 6 additions & 0 deletions sycl/plugins/unified_runtime/pi2ur.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,12 @@ piextDeviceCreateWithNativeHandle(pi_native_handle NativeHandle,
PI_ASSERT(Device, PI_ERROR_INVALID_DEVICE);
PI_ASSERT(NativeHandle, PI_ERROR_INVALID_VALUE);

ur_adapter_handle_t adapter = nullptr;
if (auto res = PiGetAdapter(adapter); res != PI_SUCCESS) {
return res;
}
(void)adapter;

ur_native_handle_t UrNativeDevice =
reinterpret_cast<ur_native_handle_t>(NativeHandle);
ur_platform_handle_t UrPlatform =
Expand Down