Skip to content

Commit af2221f

Browse files
callumfarekbenzie
andauthored
[UR] Bump UR to use new definition of ur_native_handle_t (#13705)
Co-authored-by: Kenneth Benzie (Benie) <[email protected]>
1 parent 4ab1e4b commit af2221f

File tree

2 files changed

+24
-33
lines changed

2 files changed

+24
-33
lines changed

sycl/plugins/unified_runtime/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT)
100100
endfunction()
101101

102102
set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
103-
# commit 731376d9dfbc9099a279019ec05c64f0f8c6a7ef
104-
# Merge: 40300808 665d4a68
105-
# Author: aarongreig <aaron.greig@codeplay.com>
106-
# Date: Fri Jul 5 09:44:30 2024 +0100
107-
# Merge pull request #1802 from nrspruit/fix_immediate_cmdlist_reuse
108-
# [L0] Fix immediate command list use in Command Queues
109-
set(UNIFIED_RUNTIME_TAG 0cbacd8a0844acb64091ecbb0c7d6a7df1b6160e)
103+
# commit 38bd941caf19213e9091e4da9b98df350f7c7955
104+
# Merge: fa06e95c 36ca9f15
105+
# Author: Kenneth Benzie (Benie) <k.benzie@codeplay.com>
106+
# Date: Fri Jul 5 13:48:45 2024 +0100
107+
# Merge pull request #1587 from callumfare/callum/native_handle_uintptr_t
108+
# Change ur_native_handle_t to be uintptr_t
109+
set(UNIFIED_RUNTIME_TAG 38bd941caf19213e9091e4da9b98df350f7c7955)
110110

111111
fetch_adapter_source(level_zero
112112
${UNIFIED_RUNTIME_REPO}

sycl/plugins/unified_runtime/pi2ur.hpp

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ inline pi_result piextPlatformGetNativeHandle(pi_platform Platform,
869869
ur_native_handle_t UrNativeHandle{};
870870
HANDLE_ERRORS(urPlatformGetNativeHandle(UrPlatform, &UrNativeHandle));
871871

872-
*NativeHandle = reinterpret_cast<pi_native_handle>(UrNativeHandle);
872+
*NativeHandle = UrNativeHandle;
873873

874874
return PI_SUCCESS;
875875
}
@@ -887,8 +887,7 @@ piextPlatformCreateWithNativeHandle(pi_native_handle NativeHandle,
887887
}
888888

889889
ur_platform_handle_t UrPlatform{};
890-
ur_native_handle_t UrNativeHandle =
891-
reinterpret_cast<ur_native_handle_t>(NativeHandle);
890+
ur_native_handle_t UrNativeHandle = NativeHandle;
892891
ur_platform_native_properties_t UrProperties{};
893892
urPlatformCreateWithNativeHandle(UrNativeHandle, adapter, &UrProperties,
894893
&UrPlatform);
@@ -1375,7 +1374,7 @@ inline pi_result piextDeviceGetNativeHandle(pi_device Device,
13751374

13761375
ur_native_handle_t UrNativeHandle{};
13771376
HANDLE_ERRORS(urDeviceGetNativeHandle(UrDevice, &UrNativeHandle));
1378-
*NativeHandle = reinterpret_cast<pi_native_handle>(UrNativeHandle);
1377+
*NativeHandle = UrNativeHandle;
13791378
return PI_SUCCESS;
13801379
}
13811380

@@ -1392,8 +1391,7 @@ piextDeviceCreateWithNativeHandle(pi_native_handle NativeHandle,
13921391
}
13931392
(void)adapter;
13941393

1395-
ur_native_handle_t UrNativeDevice =
1396-
reinterpret_cast<ur_native_handle_t>(NativeHandle);
1394+
ur_native_handle_t UrNativeDevice = NativeHandle;
13971395
ur_platform_handle_t UrPlatform =
13981396
reinterpret_cast<ur_platform_handle_t>(Platform);
13991397
auto UrDevice = reinterpret_cast<ur_device_handle_t *>(Device);
@@ -1583,7 +1581,7 @@ inline pi_result piextContextGetNativeHandle(pi_context Context,
15831581
reinterpret_cast<ur_context_handle_t>(Context);
15841582
ur_native_handle_t UrNativeHandle{};
15851583
HANDLE_ERRORS(urContextGetNativeHandle(UrContext, &UrNativeHandle));
1586-
*NativeHandle = reinterpret_cast<pi_native_handle>(UrNativeHandle);
1584+
*NativeHandle = UrNativeHandle;
15871585
return PI_SUCCESS;
15881586
}
15891587

@@ -1599,8 +1597,7 @@ inline pi_result piextContextCreateWithNativeHandle(
15991597
}
16001598
(void)adapter;
16011599

1602-
ur_native_handle_t NativeContext =
1603-
reinterpret_cast<ur_native_handle_t>(NativeHandle);
1600+
ur_native_handle_t NativeContext = NativeHandle;
16041601
const ur_device_handle_t *UrDevices =
16051602
reinterpret_cast<const ur_device_handle_t *>(Devices);
16061603
ur_context_handle_t *UrContext =
@@ -1777,8 +1774,7 @@ inline pi_result piextQueueCreateWithNativeHandle(
17771774
ur_context_handle_t UrContext =
17781775
reinterpret_cast<ur_context_handle_t>(Context);
17791776
ur_device_handle_t UrDevice = reinterpret_cast<ur_device_handle_t>(Device);
1780-
ur_native_handle_t UrNativeHandle =
1781-
reinterpret_cast<ur_native_handle_t>(NativeHandle);
1777+
ur_native_handle_t UrNativeHandle = NativeHandle;
17821778
ur_queue_handle_t *UrQueue = reinterpret_cast<ur_queue_handle_t *>(Queue);
17831779
ur_queue_native_properties_t UrNativeProperties{};
17841780
UrNativeProperties.isNativeHandleOwned = OwnNativeHandle;
@@ -1827,7 +1823,7 @@ inline pi_result piextQueueGetNativeHandle(pi_queue Queue,
18271823
ur_native_handle_t UrNativeQueue{};
18281824
HANDLE_ERRORS(urQueueGetNativeHandle(UrQueue, &UrNativeDesc, &UrNativeQueue));
18291825

1830-
*NativeHandle = reinterpret_cast<pi_native_handle>(UrNativeQueue);
1826+
*NativeHandle = UrNativeQueue;
18311827

18321828
return PI_SUCCESS;
18331829
}
@@ -2335,8 +2331,7 @@ piextKernelCreateWithNativeHandle(pi_native_handle NativeHandle,
23352331
PI_ASSERT(NativeHandle, PI_ERROR_INVALID_VALUE);
23362332
PI_ASSERT(Kernel, PI_ERROR_INVALID_KERNEL);
23372333

2338-
ur_native_handle_t UrNativeKernel =
2339-
reinterpret_cast<ur_native_handle_t>(NativeHandle);
2334+
ur_native_handle_t UrNativeKernel = NativeHandle;
23402335
ur_context_handle_t UrContext =
23412336
reinterpret_cast<ur_context_handle_t>(Context);
23422337
ur_program_handle_t UrProgram =
@@ -2416,7 +2411,7 @@ inline pi_result piextProgramGetNativeHandle(pi_program Program,
24162411
ur_native_handle_t NativeProgram{};
24172412
HANDLE_ERRORS(urProgramGetNativeHandle(UrProgram, &NativeProgram));
24182413

2419-
*NativeHandle = reinterpret_cast<pi_native_handle>(NativeProgram);
2414+
*NativeHandle = NativeProgram;
24202415

24212416
return PI_SUCCESS;
24222417
}
@@ -2429,8 +2424,7 @@ piextProgramCreateWithNativeHandle(pi_native_handle NativeHandle,
24292424
PI_ASSERT(NativeHandle, PI_ERROR_INVALID_VALUE);
24302425
PI_ASSERT(Context, PI_ERROR_INVALID_CONTEXT);
24312426

2432-
ur_native_handle_t NativeProgram =
2433-
reinterpret_cast<ur_native_handle_t>(NativeHandle);
2427+
ur_native_handle_t NativeProgram = NativeHandle;
24342428
ur_context_handle_t UrContext =
24352429
reinterpret_cast<ur_context_handle_t>(Context);
24362430
ur_program_handle_t *UrProgram =
@@ -2671,7 +2665,7 @@ inline pi_result piextKernelGetNativeHandle(pi_kernel Kernel,
26712665
ur_native_handle_t NativeKernel{};
26722666
HANDLE_ERRORS(urKernelGetNativeHandle(UrKernel, &NativeKernel));
26732667

2674-
*NativeHandle = reinterpret_cast<pi_native_handle>(NativeKernel);
2668+
*NativeHandle = NativeKernel;
26752669

26762670
return PI_SUCCESS;
26772671
}
@@ -3151,8 +3145,7 @@ inline pi_result piextMemImageCreateWithNativeHandle(
31513145
PI_ASSERT(NativeHandle, PI_ERROR_INVALID_VALUE);
31523146
PI_ASSERT(Context, PI_ERROR_INVALID_CONTEXT);
31533147

3154-
ur_native_handle_t UrNativeMem =
3155-
reinterpret_cast<ur_native_handle_t>(NativeHandle);
3148+
ur_native_handle_t UrNativeMem = NativeHandle;
31563149

31573150
ur_context_handle_t UrContext =
31583151
reinterpret_cast<ur_context_handle_t>(Context);
@@ -3227,7 +3220,7 @@ inline pi_result piextMemGetNativeHandle(pi_mem Mem, pi_device Dev,
32273220
ur_native_handle_t NativeMem{};
32283221
HANDLE_ERRORS(urMemGetNativeHandle(UrMem, UrDev, &NativeMem));
32293222

3230-
*NativeHandle = reinterpret_cast<pi_native_handle>(NativeMem);
3223+
*NativeHandle = NativeMem;
32313224

32323225
return PI_SUCCESS;
32333226
}
@@ -3272,8 +3265,7 @@ inline pi_result piextMemCreateWithNativeHandle(pi_native_handle NativeHandle,
32723265
PI_ASSERT(NativeHandle, PI_ERROR_INVALID_VALUE);
32733266
PI_ASSERT(Context, PI_ERROR_INVALID_CONTEXT);
32743267

3275-
ur_native_handle_t UrNativeMem =
3276-
reinterpret_cast<ur_native_handle_t>(NativeHandle);
3268+
ur_native_handle_t UrNativeMem = NativeHandle;
32773269
ur_context_handle_t UrContext =
32783270
reinterpret_cast<ur_context_handle_t>(Context);
32793271
ur_mem_handle_t *UrMem = reinterpret_cast<ur_mem_handle_t *>(Mem);
@@ -4372,7 +4364,7 @@ inline pi_result piEventCreate(pi_context Context, pi_event *RetEvent) {
43724364
// as urEventCreate
43734365
ur_event_native_properties_t Properties{};
43744366
HANDLE_ERRORS(
4375-
urEventCreateWithNativeHandle(nullptr, UrContext, &Properties, UREvent));
4367+
urEventCreateWithNativeHandle(NULL, UrContext, &Properties, UREvent));
43764368

43774369
return PI_SUCCESS;
43784370
}
@@ -4386,8 +4378,7 @@ inline pi_result piextEventCreateWithNativeHandle(pi_native_handle NativeHandle,
43864378
PI_ASSERT(Event, PI_ERROR_INVALID_EVENT);
43874379
PI_ASSERT(NativeHandle, PI_ERROR_INVALID_VALUE);
43884380

4389-
ur_native_handle_t UrNativeKernel =
4390-
reinterpret_cast<ur_native_handle_t>(NativeHandle);
4381+
ur_native_handle_t UrNativeKernel = NativeHandle;
43914382

43924383
ur_context_handle_t UrContext =
43934384
reinterpret_cast<ur_context_handle_t>(Context);

0 commit comments

Comments
 (0)