Skip to content

Commit 36347a3

Browse files
authored
[SYCL][UR] Pull in update that changes urDeviceCreateWithNativeHandle. (#15023)
The api now takes a ur_adapter_handle_t instead of a ur_platform_handle_t, which is easier for sycl RT to correctly provide and enables a fix for a few instances where we were illegally passing nullptr.
1 parent 6265a6b commit 36347a3

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

sycl/cmake/modules/FetchUnifiedRuntime.cmake

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ if(SYCL_UR_USE_FETCH_CONTENT)
117117
endfunction()
118118

119119
set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
120-
# commit d8f1c98e48e98ea2f6a227af82366734fcde977e
121-
# Merge: 6e8efa3d 9e824480
120+
# commit 0342c95cbe1dae72e874821698b3726dbe3db284
121+
# Merge: d7e0fad5 a4c6e912
122122
# Author: Omar Ahmed <[email protected]>
123-
# Date: Wed Aug 14 11:46:59 2024 +0100
124-
# Merge pull request #1946 from callumfare/callum/update_ur_trace_env_var
125-
# Update expected values of SYCL_UR_TRACE environment variable
126-
set(UNIFIED_RUNTIME_TAG d8f1c98e48e98ea2f6a227af82366734fcde977e)
123+
# Date: Thu Aug 15 17:50:02 2024 +0100
124+
# Merge pull request #1953 from aarongreig/aaron/changeDeviceCreateWithNativeParam
125+
# Change urDeviceCreateWithNativeHandle to take an adapter handle.
126+
set(UNIFIED_RUNTIME_TAG 0342c95cbe1dae72e874821698b3726dbe3db284)
127127

128128
set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES")
129129
# Due to the use of dependentloadflag and no installer for UMF and hwloc we need

sycl/source/backend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ __SYCL_EXPORT device make_device(ur_native_handle_t NativeHandle,
8484
const auto &Plugin = getPlugin(Backend);
8585

8686
ur_device_handle_t UrDevice = nullptr;
87-
Plugin->call(urDeviceCreateWithNativeHandle, NativeHandle, nullptr, nullptr,
88-
&UrDevice);
87+
Plugin->call(urDeviceCreateWithNativeHandle, NativeHandle,
88+
Plugin->getUrAdapter(), nullptr, &UrDevice);
8989
// Construct the SYCL device from UR device.
9090
return detail::createSyclObjFromImpl<device>(
9191
std::make_shared<device_impl>(UrDevice, Plugin));

sycl/source/backend/level_zero.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ __SYCL_EXPORT device make_device(const platform &Platform,
2424
// Create UR device first.
2525
ur_device_handle_t UrDevice;
2626
Plugin->call(urDeviceCreateWithNativeHandle, NativeHandle,
27-
PlatformImpl->getHandleRef(), nullptr, &UrDevice);
27+
Plugin->getUrAdapter(), nullptr, &UrDevice);
2828

2929
return detail::createSyclObjFromImpl<device>(
3030
PlatformImpl->getOrMakeDeviceImpl(UrDevice, PlatformImpl));

sycl/source/detail/device_impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ device_impl::device_impl(ur_native_handle_t InteropDeviceHandle,
4242
// Get UR device from the raw device handle.
4343
// NOTE: this is for OpenCL interop only (and should go away).
4444
// With SYCL-2020 BE generalization "make" functions are used instead.
45-
Plugin->call(urDeviceCreateWithNativeHandle, InteropDeviceHandle, nullptr,
46-
nullptr, &MDevice);
45+
Plugin->call(urDeviceCreateWithNativeHandle, InteropDeviceHandle,
46+
Plugin->getUrAdapter(), nullptr, &MDevice);
4747
InteroperabilityConstructor = true;
4848
}
4949

sycl/source/device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ device::device(cl_device_id DeviceId) {
3939
ur_device_handle_t Device;
4040
Plugin->call(urDeviceCreateWithNativeHandle,
4141
detail::ur::cast<ur_native_handle_t>(DeviceId),
42-
Plugin->getUrPlatforms()[0], nullptr, &Device);
42+
Plugin->getUrAdapter(), nullptr, &Device);
4343
auto Platform =
4444
detail::platform_impl::getPlatformFromUrDevice(Device, Plugin);
4545
impl = Platform->getOrMakeDeviceImpl(Device, Platform);

0 commit comments

Comments
 (0)