Skip to content

Commit 3bfe083

Browse files
pbalcernrspruit
authored andcommitted
[UR] call urGetAdapter before creating a device from native handle
This solves the same issues as #12432, but for urDeviceCreateWithNativeHandle. Includes required oneapi-src/unified-runtime#1252
1 parent a7f3a63 commit 3bfe083

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

sycl/plugins/unified_runtime/CMakeLists.txt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,14 @@ endif()
5656
if(SYCL_PI_UR_USE_FETCH_CONTENT)
5757
include(FetchContent)
5858

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

6968
if(SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO)
7069
set(UNIFIED_RUNTIME_REPO "${SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO}")

sycl/plugins/unified_runtime/pi2ur.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,12 @@ piextDeviceCreateWithNativeHandle(pi_native_handle NativeHandle,
13131313
PI_ASSERT(Device, PI_ERROR_INVALID_DEVICE);
13141314
PI_ASSERT(NativeHandle, PI_ERROR_INVALID_VALUE);
13151315

1316+
ur_adapter_handle_t adapter = nullptr;
1317+
if (auto res = PiGetAdapter(adapter); res != PI_SUCCESS) {
1318+
return res;
1319+
}
1320+
(void)adapter;
1321+
13161322
ur_native_handle_t UrNativeDevice =
13171323
reinterpret_cast<ur_native_handle_t>(NativeHandle);
13181324
ur_platform_handle_t UrPlatform =

0 commit comments

Comments
 (0)