From 19653002d290f6d6186c25cacecfcb757244bf25 Mon Sep 17 00:00:00 2001 From: Callum Fare Date: Wed, 8 May 2024 16:44:16 +0100 Subject: [PATCH 1/2] [UR] Bump UR to use new definition of ur_native_handle_t --- sycl/plugins/unified_runtime/CMakeLists.txt | 4 +- sycl/plugins/unified_runtime/pi2ur.hpp | 43 ++++++++------------- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/sycl/plugins/unified_runtime/CMakeLists.txt b/sycl/plugins/unified_runtime/CMakeLists.txt index 252deba45219a..1d7c36a7b4084 100644 --- a/sycl/plugins/unified_runtime/CMakeLists.txt +++ b/sycl/plugins/unified_runtime/CMakeLists.txt @@ -99,13 +99,13 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT) CACHE PATH "Path to external '${name}' adapter source dir" FORCE) endfunction() - set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git") + set(UNIFIED_RUNTIME_REPO "https://github.com/callumfare/unified-runtime.git") # commit aaf08109f2a05adb61f50478824ae2739526daee # Author: Ben Tracy # Date: Mon Jun 17 14:49:53 2024 +0100 # [CMDBUF] Fix coverity issue in command buffers # - Fix incorrect conditions for copy engine usage that were reported on coverity. - set(UNIFIED_RUNTIME_TAG aaf08109f2a05adb61f50478824ae2739526daee) + set(UNIFIED_RUNTIME_TAG 36ca9f1568345c4710bfa157f6ee47431eba99ee) fetch_adapter_source(level_zero ${UNIFIED_RUNTIME_REPO} diff --git a/sycl/plugins/unified_runtime/pi2ur.hpp b/sycl/plugins/unified_runtime/pi2ur.hpp index 3690c78d61b47..34af6e7805f75 100644 --- a/sycl/plugins/unified_runtime/pi2ur.hpp +++ b/sycl/plugins/unified_runtime/pi2ur.hpp @@ -869,7 +869,7 @@ inline pi_result piextPlatformGetNativeHandle(pi_platform Platform, ur_native_handle_t UrNativeHandle{}; HANDLE_ERRORS(urPlatformGetNativeHandle(UrPlatform, &UrNativeHandle)); - *NativeHandle = reinterpret_cast(UrNativeHandle); + *NativeHandle = UrNativeHandle; return PI_SUCCESS; } @@ -887,8 +887,7 @@ piextPlatformCreateWithNativeHandle(pi_native_handle NativeHandle, } ur_platform_handle_t UrPlatform{}; - ur_native_handle_t UrNativeHandle = - reinterpret_cast(NativeHandle); + ur_native_handle_t UrNativeHandle = NativeHandle; ur_platform_native_properties_t UrProperties{}; urPlatformCreateWithNativeHandle(UrNativeHandle, adapter, &UrProperties, &UrPlatform); @@ -1373,7 +1372,7 @@ inline pi_result piextDeviceGetNativeHandle(pi_device Device, ur_native_handle_t UrNativeHandle{}; HANDLE_ERRORS(urDeviceGetNativeHandle(UrDevice, &UrNativeHandle)); - *NativeHandle = reinterpret_cast(UrNativeHandle); + *NativeHandle = UrNativeHandle; return PI_SUCCESS; } @@ -1390,8 +1389,7 @@ piextDeviceCreateWithNativeHandle(pi_native_handle NativeHandle, } (void)adapter; - ur_native_handle_t UrNativeDevice = - reinterpret_cast(NativeHandle); + ur_native_handle_t UrNativeDevice = NativeHandle; ur_platform_handle_t UrPlatform = reinterpret_cast(Platform); auto UrDevice = reinterpret_cast(Device); @@ -1581,7 +1579,7 @@ inline pi_result piextContextGetNativeHandle(pi_context Context, reinterpret_cast(Context); ur_native_handle_t UrNativeHandle{}; HANDLE_ERRORS(urContextGetNativeHandle(UrContext, &UrNativeHandle)); - *NativeHandle = reinterpret_cast(UrNativeHandle); + *NativeHandle = UrNativeHandle; return PI_SUCCESS; } @@ -1597,8 +1595,7 @@ inline pi_result piextContextCreateWithNativeHandle( } (void)adapter; - ur_native_handle_t NativeContext = - reinterpret_cast(NativeHandle); + ur_native_handle_t NativeContext = NativeHandle; const ur_device_handle_t *UrDevices = reinterpret_cast(Devices); ur_context_handle_t *UrContext = @@ -1775,8 +1772,7 @@ inline pi_result piextQueueCreateWithNativeHandle( ur_context_handle_t UrContext = reinterpret_cast(Context); ur_device_handle_t UrDevice = reinterpret_cast(Device); - ur_native_handle_t UrNativeHandle = - reinterpret_cast(NativeHandle); + ur_native_handle_t UrNativeHandle = NativeHandle; ur_queue_handle_t *UrQueue = reinterpret_cast(Queue); ur_queue_native_properties_t UrNativeProperties{}; UrNativeProperties.isNativeHandleOwned = OwnNativeHandle; @@ -1825,7 +1821,7 @@ inline pi_result piextQueueGetNativeHandle(pi_queue Queue, ur_native_handle_t UrNativeQueue{}; HANDLE_ERRORS(urQueueGetNativeHandle(UrQueue, &UrNativeDesc, &UrNativeQueue)); - *NativeHandle = reinterpret_cast(UrNativeQueue); + *NativeHandle = UrNativeQueue; return PI_SUCCESS; } @@ -2333,8 +2329,7 @@ piextKernelCreateWithNativeHandle(pi_native_handle NativeHandle, PI_ASSERT(NativeHandle, PI_ERROR_INVALID_VALUE); PI_ASSERT(Kernel, PI_ERROR_INVALID_KERNEL); - ur_native_handle_t UrNativeKernel = - reinterpret_cast(NativeHandle); + ur_native_handle_t UrNativeKernel = NativeHandle; ur_context_handle_t UrContext = reinterpret_cast(Context); ur_program_handle_t UrProgram = @@ -2414,7 +2409,7 @@ inline pi_result piextProgramGetNativeHandle(pi_program Program, ur_native_handle_t NativeProgram{}; HANDLE_ERRORS(urProgramGetNativeHandle(UrProgram, &NativeProgram)); - *NativeHandle = reinterpret_cast(NativeProgram); + *NativeHandle = NativeProgram; return PI_SUCCESS; } @@ -2427,8 +2422,7 @@ piextProgramCreateWithNativeHandle(pi_native_handle NativeHandle, PI_ASSERT(NativeHandle, PI_ERROR_INVALID_VALUE); PI_ASSERT(Context, PI_ERROR_INVALID_CONTEXT); - ur_native_handle_t NativeProgram = - reinterpret_cast(NativeHandle); + ur_native_handle_t NativeProgram = NativeHandle; ur_context_handle_t UrContext = reinterpret_cast(Context); ur_program_handle_t *UrProgram = @@ -2679,7 +2673,7 @@ inline pi_result piextKernelGetNativeHandle(pi_kernel Kernel, ur_native_handle_t NativeKernel{}; HANDLE_ERRORS(urKernelGetNativeHandle(UrKernel, &NativeKernel)); - *NativeHandle = reinterpret_cast(NativeKernel); + *NativeHandle = NativeKernel; return PI_SUCCESS; } @@ -3159,8 +3153,7 @@ inline pi_result piextMemImageCreateWithNativeHandle( PI_ASSERT(NativeHandle, PI_ERROR_INVALID_VALUE); PI_ASSERT(Context, PI_ERROR_INVALID_CONTEXT); - ur_native_handle_t UrNativeMem = - reinterpret_cast(NativeHandle); + ur_native_handle_t UrNativeMem = NativeHandle; ur_context_handle_t UrContext = reinterpret_cast(Context); @@ -3235,7 +3228,7 @@ inline pi_result piextMemGetNativeHandle(pi_mem Mem, pi_device Dev, ur_native_handle_t NativeMem{}; HANDLE_ERRORS(urMemGetNativeHandle(UrMem, UrDev, &NativeMem)); - *NativeHandle = reinterpret_cast(NativeMem); + *NativeHandle = NativeMem; return PI_SUCCESS; } @@ -3280,8 +3273,7 @@ inline pi_result piextMemCreateWithNativeHandle(pi_native_handle NativeHandle, PI_ASSERT(NativeHandle, PI_ERROR_INVALID_VALUE); PI_ASSERT(Context, PI_ERROR_INVALID_CONTEXT); - ur_native_handle_t UrNativeMem = - reinterpret_cast(NativeHandle); + ur_native_handle_t UrNativeMem = NativeHandle; ur_context_handle_t UrContext = reinterpret_cast(Context); ur_mem_handle_t *UrMem = reinterpret_cast(Mem); @@ -4329,7 +4321,7 @@ inline pi_result piEventCreate(pi_context Context, pi_event *RetEvent) { // as urEventCreate ur_event_native_properties_t Properties{}; HANDLE_ERRORS( - urEventCreateWithNativeHandle(nullptr, UrContext, &Properties, UREvent)); + urEventCreateWithNativeHandle(NULL, UrContext, &Properties, UREvent)); return PI_SUCCESS; } @@ -4343,8 +4335,7 @@ inline pi_result piextEventCreateWithNativeHandle(pi_native_handle NativeHandle, PI_ASSERT(Event, PI_ERROR_INVALID_EVENT); PI_ASSERT(NativeHandle, PI_ERROR_INVALID_VALUE); - ur_native_handle_t UrNativeKernel = - reinterpret_cast(NativeHandle); + ur_native_handle_t UrNativeKernel = NativeHandle; ur_context_handle_t UrContext = reinterpret_cast(Context); From edbafe6f716e8ee72ff15df7d496ce85bfa6b84b Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Fri, 5 Jul 2024 13:49:50 +0100 Subject: [PATCH 2/2] [UR] Bump main tag to 38bd941c --- sycl/plugins/unified_runtime/CMakeLists.txt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sycl/plugins/unified_runtime/CMakeLists.txt b/sycl/plugins/unified_runtime/CMakeLists.txt index 1d7c36a7b4084..84e5d989bdf05 100644 --- a/sycl/plugins/unified_runtime/CMakeLists.txt +++ b/sycl/plugins/unified_runtime/CMakeLists.txt @@ -99,13 +99,14 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT) CACHE PATH "Path to external '${name}' adapter source dir" FORCE) endfunction() - set(UNIFIED_RUNTIME_REPO "https://github.com/callumfare/unified-runtime.git") - # commit aaf08109f2a05adb61f50478824ae2739526daee - # Author: Ben Tracy - # Date: Mon Jun 17 14:49:53 2024 +0100 - # [CMDBUF] Fix coverity issue in command buffers - # - Fix incorrect conditions for copy engine usage that were reported on coverity. - set(UNIFIED_RUNTIME_TAG 36ca9f1568345c4710bfa157f6ee47431eba99ee) + set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git") + # commit 38bd941caf19213e9091e4da9b98df350f7c7955 + # Merge: fa06e95c 36ca9f15 + # Author: Kenneth Benzie (Benie) + # Date: Fri Jul 5 13:48:45 2024 +0100 + # Merge pull request #1587 from callumfare/callum/native_handle_uintptr_t + # Change ur_native_handle_t to be uintptr_t + set(UNIFIED_RUNTIME_TAG 38bd941caf19213e9091e4da9b98df350f7c7955) fetch_adapter_source(level_zero ${UNIFIED_RUNTIME_REPO}