Skip to content
Merged
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
14 changes: 7 additions & 7 deletions sycl/plugins/unified_runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT)
endfunction()

set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
# commit 731376d9dfbc9099a279019ec05c64f0f8c6a7ef
# Merge: 40300808 665d4a68
# Author: aarongreig <aaron.greig@codeplay.com>
# Date: Fri Jul 5 09:44:30 2024 +0100
# Merge pull request #1802 from nrspruit/fix_immediate_cmdlist_reuse
# [L0] Fix immediate command list use in Command Queues
set(UNIFIED_RUNTIME_TAG 0cbacd8a0844acb64091ecbb0c7d6a7df1b6160e)
# commit 38bd941caf19213e9091e4da9b98df350f7c7955
# Merge: fa06e95c 36ca9f15
# Author: Kenneth Benzie (Benie) <k.benzie@codeplay.com>
# 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}
Expand Down
43 changes: 17 additions & 26 deletions sycl/plugins/unified_runtime/pi2ur.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ inline pi_result piextPlatformGetNativeHandle(pi_platform Platform,
ur_native_handle_t UrNativeHandle{};
HANDLE_ERRORS(urPlatformGetNativeHandle(UrPlatform, &UrNativeHandle));

*NativeHandle = reinterpret_cast<pi_native_handle>(UrNativeHandle);
*NativeHandle = UrNativeHandle;

return PI_SUCCESS;
}
Expand All @@ -887,8 +887,7 @@ piextPlatformCreateWithNativeHandle(pi_native_handle NativeHandle,
}

ur_platform_handle_t UrPlatform{};
ur_native_handle_t UrNativeHandle =
reinterpret_cast<ur_native_handle_t>(NativeHandle);
ur_native_handle_t UrNativeHandle = NativeHandle;
ur_platform_native_properties_t UrProperties{};
urPlatformCreateWithNativeHandle(UrNativeHandle, adapter, &UrProperties,
&UrPlatform);
Expand Down Expand Up @@ -1373,7 +1372,7 @@ inline pi_result piextDeviceGetNativeHandle(pi_device Device,

ur_native_handle_t UrNativeHandle{};
HANDLE_ERRORS(urDeviceGetNativeHandle(UrDevice, &UrNativeHandle));
*NativeHandle = reinterpret_cast<pi_native_handle>(UrNativeHandle);
*NativeHandle = UrNativeHandle;
return PI_SUCCESS;
}

Expand All @@ -1390,8 +1389,7 @@ piextDeviceCreateWithNativeHandle(pi_native_handle NativeHandle,
}
(void)adapter;

ur_native_handle_t UrNativeDevice =
reinterpret_cast<ur_native_handle_t>(NativeHandle);
ur_native_handle_t UrNativeDevice = NativeHandle;
ur_platform_handle_t UrPlatform =
reinterpret_cast<ur_platform_handle_t>(Platform);
auto UrDevice = reinterpret_cast<ur_device_handle_t *>(Device);
Expand Down Expand Up @@ -1581,7 +1579,7 @@ inline pi_result piextContextGetNativeHandle(pi_context Context,
reinterpret_cast<ur_context_handle_t>(Context);
ur_native_handle_t UrNativeHandle{};
HANDLE_ERRORS(urContextGetNativeHandle(UrContext, &UrNativeHandle));
*NativeHandle = reinterpret_cast<pi_native_handle>(UrNativeHandle);
*NativeHandle = UrNativeHandle;
return PI_SUCCESS;
}

Expand All @@ -1597,8 +1595,7 @@ inline pi_result piextContextCreateWithNativeHandle(
}
(void)adapter;

ur_native_handle_t NativeContext =
reinterpret_cast<ur_native_handle_t>(NativeHandle);
ur_native_handle_t NativeContext = NativeHandle;
const ur_device_handle_t *UrDevices =
reinterpret_cast<const ur_device_handle_t *>(Devices);
ur_context_handle_t *UrContext =
Expand Down Expand Up @@ -1775,8 +1772,7 @@ inline pi_result piextQueueCreateWithNativeHandle(
ur_context_handle_t UrContext =
reinterpret_cast<ur_context_handle_t>(Context);
ur_device_handle_t UrDevice = reinterpret_cast<ur_device_handle_t>(Device);
ur_native_handle_t UrNativeHandle =
reinterpret_cast<ur_native_handle_t>(NativeHandle);
ur_native_handle_t UrNativeHandle = NativeHandle;
ur_queue_handle_t *UrQueue = reinterpret_cast<ur_queue_handle_t *>(Queue);
ur_queue_native_properties_t UrNativeProperties{};
UrNativeProperties.isNativeHandleOwned = OwnNativeHandle;
Expand Down Expand Up @@ -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<pi_native_handle>(UrNativeQueue);
*NativeHandle = UrNativeQueue;

return PI_SUCCESS;
}
Expand Down Expand Up @@ -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<ur_native_handle_t>(NativeHandle);
ur_native_handle_t UrNativeKernel = NativeHandle;
ur_context_handle_t UrContext =
reinterpret_cast<ur_context_handle_t>(Context);
ur_program_handle_t UrProgram =
Expand Down Expand Up @@ -2414,7 +2409,7 @@ inline pi_result piextProgramGetNativeHandle(pi_program Program,
ur_native_handle_t NativeProgram{};
HANDLE_ERRORS(urProgramGetNativeHandle(UrProgram, &NativeProgram));

*NativeHandle = reinterpret_cast<pi_native_handle>(NativeProgram);
*NativeHandle = NativeProgram;

return PI_SUCCESS;
}
Expand All @@ -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<ur_native_handle_t>(NativeHandle);
ur_native_handle_t NativeProgram = NativeHandle;
ur_context_handle_t UrContext =
reinterpret_cast<ur_context_handle_t>(Context);
ur_program_handle_t *UrProgram =
Expand Down Expand Up @@ -2669,7 +2663,7 @@ inline pi_result piextKernelGetNativeHandle(pi_kernel Kernel,
ur_native_handle_t NativeKernel{};
HANDLE_ERRORS(urKernelGetNativeHandle(UrKernel, &NativeKernel));

*NativeHandle = reinterpret_cast<pi_native_handle>(NativeKernel);
*NativeHandle = NativeKernel;

return PI_SUCCESS;
}
Expand Down Expand Up @@ -3149,8 +3143,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<ur_native_handle_t>(NativeHandle);
ur_native_handle_t UrNativeMem = NativeHandle;

ur_context_handle_t UrContext =
reinterpret_cast<ur_context_handle_t>(Context);
Expand Down Expand Up @@ -3225,7 +3218,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<pi_native_handle>(NativeMem);
*NativeHandle = NativeMem;

return PI_SUCCESS;
}
Expand Down Expand Up @@ -3270,8 +3263,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<ur_native_handle_t>(NativeHandle);
ur_native_handle_t UrNativeMem = NativeHandle;
ur_context_handle_t UrContext =
reinterpret_cast<ur_context_handle_t>(Context);
ur_mem_handle_t *UrMem = reinterpret_cast<ur_mem_handle_t *>(Mem);
Expand Down Expand Up @@ -4319,7 +4311,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;
}
Expand All @@ -4333,8 +4325,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<ur_native_handle_t>(NativeHandle);
ur_native_handle_t UrNativeKernel = NativeHandle;

ur_context_handle_t UrContext =
reinterpret_cast<ur_context_handle_t>(Context);
Expand Down