From e1af2f1a1ee1ffa1e7004af5cbb8021f44f5e083 Mon Sep 17 00:00:00 2001 From: Jaime Arteaga Date: Fri, 10 Feb 2023 19:56:41 -0800 Subject: [PATCH] [SYCL][UR] Add stubs in L0 adapter Signed-off-by: Jaime Arteaga --- sycl/plugins/level_zero/CMakeLists.txt | 4 +- sycl/plugins/unified_runtime/CMakeLists.txt | 4 +- .../ur/adapters/level_zero/ur_level_zero.cpp | 6 - .../level_zero/ur_level_zero_common.cpp | 11 + .../level_zero/ur_level_zero_common.hpp | 19 +- .../level_zero/ur_level_zero_context.cpp | 75 ++ .../level_zero/ur_level_zero_device.cpp | 48 ++ .../level_zero/ur_level_zero_event.cpp | 112 +++ .../level_zero/ur_level_zero_kernel.cpp | 269 +++++++ ...ro_module.hpp => ur_level_zero_kernel.hpp} | 6 +- .../adapters/level_zero/ur_level_zero_mem.cpp | 667 ++++++++++++++++++ .../level_zero/ur_level_zero_module.cpp | 9 - .../level_zero/ur_level_zero_platform.cpp | 53 ++ .../level_zero/ur_level_zero_program.cpp | 183 +++++ .../level_zero/ur_level_zero_queue.cpp | 76 ++ .../level_zero/ur_level_zero_sampler.cpp | 61 ++ .../level_zero/ur_loader_interface.cpp | 201 +++--- sycl/plugins/unified_runtime/ur_bindings.hpp | 4 - 18 files changed, 1684 insertions(+), 124 deletions(-) create mode 100644 sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_kernel.cpp rename sycl/plugins/unified_runtime/ur/adapters/level_zero/{ur_level_zero_module.hpp => ur_level_zero_kernel.hpp} (75%) delete mode 100644 sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_module.cpp diff --git a/sycl/plugins/level_zero/CMakeLists.txt b/sycl/plugins/level_zero/CMakeLists.txt index aabbb4e5daa88..62be70c052a95 100755 --- a/sycl/plugins/level_zero/CMakeLists.txt +++ b/sycl/plugins/level_zero/CMakeLists.txt @@ -106,7 +106,7 @@ add_sycl_plugin(level_zero "../unified_runtime/ur/adapters/level_zero/ur_level_zero_device.hpp" "../unified_runtime/ur/adapters/level_zero/ur_level_zero_event.hpp" "../unified_runtime/ur/adapters/level_zero/ur_level_zero_mem.hpp" - "../unified_runtime/ur/adapters/level_zero/ur_level_zero_module.hpp" + "../unified_runtime/ur/adapters/level_zero/ur_level_zero_kernel.hpp" "../unified_runtime/ur/adapters/level_zero/ur_level_zero_platform.hpp" "../unified_runtime/ur/adapters/level_zero/ur_level_zero_program.hpp" "../unified_runtime/ur/adapters/level_zero/ur_level_zero_queue.hpp" @@ -117,7 +117,7 @@ add_sycl_plugin(level_zero "../unified_runtime/ur/adapters/level_zero/ur_level_zero_device.cpp" "../unified_runtime/ur/adapters/level_zero/ur_level_zero_event.cpp" "../unified_runtime/ur/adapters/level_zero/ur_level_zero_mem.cpp" - "../unified_runtime/ur/adapters/level_zero/ur_level_zero_module.cpp" + "../unified_runtime/ur/adapters/level_zero/ur_level_zero_kernel.cpp" "../unified_runtime/ur/adapters/level_zero/ur_level_zero_platform.cpp" "../unified_runtime/ur/adapters/level_zero/ur_level_zero_program.cpp" "../unified_runtime/ur/adapters/level_zero/ur_level_zero_queue.cpp" diff --git a/sycl/plugins/unified_runtime/CMakeLists.txt b/sycl/plugins/unified_runtime/CMakeLists.txt index 664dd7dc51856..556bfd67bb9d2 100755 --- a/sycl/plugins/unified_runtime/CMakeLists.txt +++ b/sycl/plugins/unified_runtime/CMakeLists.txt @@ -88,7 +88,7 @@ add_sycl_library("ur_adapter_level_zero" SHARED "ur/adapters/level_zero/ur_level_zero_device.hpp" "ur/adapters/level_zero/ur_level_zero_event.hpp" "ur/adapters/level_zero/ur_level_zero_mem.hpp" - "ur/adapters/level_zero/ur_level_zero_module.hpp" + "ur/adapters/level_zero/ur_level_zero_kernel.hpp" "ur/adapters/level_zero/ur_level_zero_platform.hpp" "ur/adapters/level_zero/ur_level_zero_program.hpp" "ur/adapters/level_zero/ur_level_zero_queue.hpp" @@ -99,7 +99,7 @@ add_sycl_library("ur_adapter_level_zero" SHARED "ur/adapters/level_zero/ur_level_zero_device.cpp" "ur/adapters/level_zero/ur_level_zero_event.cpp" "ur/adapters/level_zero/ur_level_zero_mem.cpp" - "ur/adapters/level_zero/ur_level_zero_module.cpp" + "ur/adapters/level_zero/ur_level_zero_kernel.cpp" "ur/adapters/level_zero/ur_level_zero_platform.cpp" "ur/adapters/level_zero/ur_level_zero_program.cpp" "ur/adapters/level_zero/ur_level_zero_queue.cpp" diff --git a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero.cpp b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero.cpp index 44e6a632444ee..1f4c5da7f48da 100644 --- a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero.cpp +++ b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero.cpp @@ -1741,9 +1741,3 @@ ur_result_t urDevicePartition( } return UR_RESULT_SUCCESS; } - -ur_result_t urInit(ur_device_init_flags_t device_flags) { - return UR_RESULT_SUCCESS; -} - -ur_result_t urTearDown(void *pParams) { return UR_RESULT_SUCCESS; } diff --git a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_common.cpp b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_common.cpp index 088369e1cb43d..f20ce6c3e0bdb 100644 --- a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_common.cpp +++ b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_common.cpp @@ -7,6 +7,8 @@ //===-----------------------------------------------------------------===// #include "ur_level_zero_common.hpp" +#include +#include std::unordered_map Ze2UrErrorMapping = { {ZE_RESULT_SUCCESS, UR_RESULT_SUCCESS}, @@ -45,3 +47,12 @@ ur_result_t ze2urResult(ze_result_t ZeResult) { } return It->second; } + +void urPrint(const char *Format, ...) { + if (UrL0Debug & UR_L0_DEBUG_BASIC) { + va_list Args; + va_start(Args, Format); + vfprintf(stderr, Format, Args); + va_end(Args); + } +} diff --git a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_common.hpp b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_common.hpp index cbbdb11a24edc..3ec643bde2fb7 100644 --- a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_common.hpp +++ b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_common.hpp @@ -16,8 +16,8 @@ #include "ur_level_zero_context.hpp" #include "ur_level_zero_device.hpp" #include "ur_level_zero_event.hpp" +#include "ur_level_zero_kernel.hpp" #include "ur_level_zero_mem.hpp" -#include "ur_level_zero_module.hpp" #include "ur_level_zero_platform.hpp" #include "ur_level_zero_program.hpp" #include "ur_level_zero_queue.hpp" @@ -25,3 +25,20 @@ // Map Level Zero runtime error code to UR error code. ur_result_t ze2urResult(ze_result_t ZeResult); + +// Controls Level Zero calls tracing. +enum UrDebugLevel { + UR_L0_DEBUG_NONE = 0x0, + UR_L0_DEBUG_BASIC = 0x1, + UR_L0_DEBUG_VALIDATION = 0x2, + UR_L0_DEBUG_CALL_COUNT = 0x4, + UR_L0_DEBUG_ALL = -1 +}; + +const int UrL0Debug = [] { + const char *DebugMode = std::getenv("UR_L0_DEBUG"); + return DebugMode ? std::atoi(DebugMode) : UR_L0_DEBUG_NONE; +}(); + +// Prints to stderr if UR_L0_DEBUG allows it +void urPrint(const char *Format, ...); diff --git a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_context.cpp b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_context.cpp index 43b8d9981b039..6f745aadeec42 100644 --- a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_context.cpp +++ b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_context.cpp @@ -7,3 +7,78 @@ //===-----------------------------------------------------------------===// #include "ur_level_zero_context.hpp" + +UR_APIEXPORT ur_result_t UR_APICALL urContextCreate( + uint32_t DeviceCount, ///< [in] the number of devices given in phDevices + const ur_device_handle_t + *Devices, ///< [in][range(0, DeviceCount)] array of handle of devices. + const ur_context_properties_t + *Properties, ///< [in][optional] pointer to context creation properties. + ur_context_handle_t + *RetContext ///< [out] pointer to handle of context object created +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urContextRetain( + ur_context_handle_t + Context ///< [in] handle of the context to get a reference of. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urContextRelease( + ur_context_handle_t Context ///< [in] handle of the context to release. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urContextGetInfo( + ur_context_handle_t Context, ///< [in] handle of the context + ur_context_info_t ContextInfoType, ///< [in] type of the info to retrieve + size_t PropSize, ///< [in] the number of bytes of memory pointed to by + ///< pContextInfo. + void *ContextInfo, ///< [out][optional] array of bytes holding the info. + ///< if propSize is not equal to or greater than the + ///< real number of bytes needed to return the info then + ///< the ::UR_RESULT_ERROR_INVALID_SIZE error is + ///< returned and pContextInfo is not used. + size_t *PropSizeRet ///< [out][optional] pointer to the actual size in + ///< bytes of data queried by ContextInfoType. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urContextGetNativeHandle( + ur_context_handle_t Context, ///< [in] handle of the context. + ur_native_handle_t *NativeContext ///< [out] a pointer to the native + ///< handle of the context. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urContextCreateWithNativeHandle( + ur_native_handle_t + NativeContext, ///< [in] the native handle of the context. + ur_context_handle_t *Context ///< [out] pointer to the handle of the + ///< context object created. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urContextSetExtendedDeleter( + ur_context_handle_t Context, ///< [in] handle of the context. + ur_context_extended_deleter_t + Deleter, ///< [in] Function pointer to extended deleter. + void *UserData ///< [in][out][optional] pointer to data to be passed to + ///< callback. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} diff --git a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_device.cpp b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_device.cpp index 4ef5d989ca953..7030b0aed5378 100644 --- a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_device.cpp +++ b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_device.cpp @@ -7,3 +7,51 @@ //===-----------------------------------------------------------------===// #include "ur_level_zero_device.hpp" + +UR_APIEXPORT ur_result_t UR_APICALL urDeviceSelectBinary( + ur_device_handle_t + Device, ///< [in] handle of the device to select binary for. + const uint8_t **Binaries, ///< [in] the array of binaries to select from. + uint32_t NumBinaries, ///< [in] the number of binaries passed in ppBinaries. + ///< Must greater than or equal to zero otherwise + ///< ::UR_RESULT_ERROR_INVALID_VALUE is returned. + uint32_t + *SelectedBinary ///< [out] the index of the selected binary in the input + ///< array of binaries. If a suitable binary was not + ///< found the function returns ${X}_INVALID_BINARY. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetNativeHandle( + ur_device_handle_t Device, ///< [in] handle of the device. + ur_native_handle_t + *NativeDevice ///< [out] a pointer to the native handle of the device. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( + ur_native_handle_t NativeDevice, ///< [in] the native handle of the device. + ur_platform_handle_t Platform, ///< [in] handle of the platform instance + ur_device_handle_t + *Device ///< [out] pointer to the handle of the device object created. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetGlobalTimestamps( + ur_device_handle_t Device, ///< [in] handle of the device instance + uint64_t *DeviceTimestamp, ///< [out][optional] pointer to the Device's + ///< global timestamp that correlates with the + ///< Host's global timestamp value + uint64_t *HostTimestamp ///< [out][optional] pointer to the Host's global + ///< timestamp that correlates with the Device's + ///< global timestamp value +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} diff --git a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_event.cpp b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_event.cpp index 2889db7884b0e..35ca18d63a3de 100644 --- a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_event.cpp +++ b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_event.cpp @@ -7,3 +7,115 @@ //===-----------------------------------------------------------------===// #include "ur_level_zero_event.hpp" + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueEventsWait( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before this command can be executed. If nullptr, + ///< the numEventsInWaitList must be 0, indicating that + ///< all previously enqueued commands must be complete. + ur_event_handle_t *Event ///< [in,out][optional] return an event object that + ///< identifies this particular command instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrier( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before this command can be executed. If nullptr, + ///< the numEventsInWaitList must be 0, indicating that + ///< all previously enqueued commands must be complete. + ur_event_handle_t *Event ///< [in,out][optional] return an event object that + ///< identifies this particular command instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEventGetInfo( + ur_event_handle_t Event, ///< [in] handle of the event object + ur_event_info_t PropName, ///< [in] the name of the event property to query + size_t PropValueSize, ///< [in] size in bytes of the event property value + void *PropValue, ///< [out][optional] value of the event property + size_t + *PropValueSizeRet ///< [out][optional] bytes returned in event property +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEventGetProfilingInfo( + ur_event_handle_t Event, ///< [in] handle of the event object + ur_profiling_info_t + PropName, ///< [in] the name of the profiling property to query + size_t + PropValueSize, ///< [in] size in bytes of the profiling property value + void *PropValue, ///< [out][optional] value of the profiling property + size_t *PropValueSizeRet ///< [out][optional] pointer to the actual size in + ///< bytes returned in propValue +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEventWait( + uint32_t NumEvents, ///< [in] number of events in the event list + const ur_event_handle_t + *EventWaitList ///< [in][range(0, numEvents)] pointer to a list of + ///< events to wait for completion +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEventRetain( + ur_event_handle_t Event ///< [in] handle of the event object +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEventRelease( + ur_event_handle_t Event ///< [in] handle of the event object +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEventGetNativeHandle( + ur_event_handle_t Event, ///< [in] handle of the event. + ur_native_handle_t + *NativeEvent ///< [out] a pointer to the native handle of the event. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEventCreateWithNativeHandle( + ur_native_handle_t NativeEvent, ///< [in] the native handle of the event. + ur_context_handle_t Context, ///< [in] handle of the context object + ur_event_handle_t + *Event ///< [out] pointer to the handle of the event object created. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEventSetCallback( + ur_event_handle_t Event, ///< [in] handle of the event object + ur_execution_info_t ExecStatus, ///< [in] execution status of the event + ur_event_callback_t Notify, ///< [in] execution status of the event + void *UserData ///< [in][out][optional] pointer to data to be passed to + ///< callback. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} diff --git a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_kernel.cpp b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_kernel.cpp new file mode 100644 index 0000000000000..4f5098511549f --- /dev/null +++ b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_kernel.cpp @@ -0,0 +1,269 @@ +//===--------- ur_level_zero_kernel.cpp - Level Zero Adapter ----------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===-----------------------------------------------------------------===// + +#include "ur_level_zero_kernel.hpp" + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueKernelLaunch( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + ur_kernel_handle_t Kernel, ///< [in] handle of the kernel object + uint32_t workDim, ///< [in] number of dimensions, from 1 to 3, to specify + ///< the global and work-group work-items + const size_t + *GlobalWorkOffset, ///< [in] pointer to an array of workDim unsigned + ///< values that specify the offset used to + ///< calculate the global ID of a work-item + const size_t *GlobalWorkSize, ///< [in] pointer to an array of workDim + ///< unsigned values that specify the number + ///< of global work-items in workDim that + ///< will execute the kernel function + const size_t + *LocalWorkSize, ///< [in][optional] pointer to an array of workDim + ///< unsigned values that specify the number of local + ///< work-items forming a work-group that will execute + ///< the kernel function. If nullptr, the runtime + ///< implementation will choose the work-group size. + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before the kernel execution. If nullptr, the + ///< numEventsInWaitList must be 0, indicating that no + ///< wait event. + ur_event_handle_t + *Event ///< [in,out][optional] return an event object that identifies + ///< this particular kernel execution instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableWrite( + ur_queue_handle_t Queue, ///< [in] handle of the queue to submit to. + ur_program_handle_t Program, ///< [in] handle of the program containing the + ///< device global variable. + const char + *Name, ///< [in] the unique identifier for the device global variable. + bool BlockingWrite, ///< [in] indicates if this operation should block. + size_t Count, ///< [in] the number of bytes to copy. + size_t Offset, ///< [in] the byte offset into the device global variable to + ///< start copying. + const void *Src, ///< [in] pointer to where the data must be copied from. + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list. + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before the kernel execution. If nullptr, the + ///< numEventsInWaitList must be 0, indicating that no + ///< wait event. + ur_event_handle_t + *Event ///< [in,out][optional] return an event object that identifies + ///< this particular kernel execution instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableRead( + ur_queue_handle_t Queue, ///< [in] handle of the queue to submit to. + ur_program_handle_t Program, ///< [in] handle of the program containing the + ///< device global variable. + const char + *Name, ///< [in] the unique identifier for the device global variable. + bool BlockingRead, ///< [in] indicates if this operation should block. + size_t Count, ///< [in] the number of bytes to copy. + size_t Offset, ///< [in] the byte offset into the device global variable to + ///< start copying. + void *Dst, ///< [in] pointer to where the data must be copied to. + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list. + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before the kernel execution. If nullptr, the + ///< numEventsInWaitList must be 0, indicating that no + ///< wait event. + ur_event_handle_t + *Event ///< [in,out][optional] return an event object that identifies + ///< this particular kernel execution instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urKernelCreate( + ur_program_handle_t Program, ///< [in] handle of the program instance + const char *KernelName, ///< [in] pointer to null-terminated string. + ur_kernel_handle_t + *Kernel ///< [out] pointer to handle of kernel object created. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urKernelSetArgValue( + ur_kernel_handle_t Kernel, ///< [in] handle of the kernel object + uint32_t ArgIndex, ///< [in] argument index in range [0, num args - 1] + size_t ArgSize, ///< [in] size of argument type + const void + *ArgValue ///< [in] argument value represented as matching arg type. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urKernelSetArgLocal( + ur_kernel_handle_t Kernel, ///< [in] handle of the kernel object + uint32_t ArgIndex, ///< [in] argument index in range [0, num args - 1] + size_t ArgSize ///< [in] size of the local buffer to be allocated by the + ///< runtime +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urKernelGetInfo( + ur_kernel_handle_t Kernel, ///< [in] handle of the Kernel object + ur_kernel_info_t PropName, ///< [in] name of the Kernel property to query + size_t PropSize, ///< [in] the size of the Kernel property value. + void *KernelInfo, ///< [in,out][optional] array of bytes holding the kernel + ///< info property. If propSize is not equal to or + ///< greater than the real number of bytes needed to + ///< return the info then the + ///< ::UR_RESULT_ERROR_INVALID_SIZE error is returned and + ///< pKernelInfo is not used. + size_t *PropSizeRet ///< [out][optional] pointer to the actual size in + ///< bytes of data being queried by propName. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urKernelGetGroupInfo( + ur_kernel_handle_t Kernel, ///< [in] handle of the Kernel object + ur_device_handle_t Device, ///< [in] handle of the Device object + ur_kernel_group_info_t + PropName, ///< [in] name of the work Group property to query + size_t PropSize, ///< [in] size of the Kernel Work Group property value + void *PropValue, ///< [in,out][optional][range(0, propSize)] value of the + ///< Kernel Work Group property. + size_t *PropSizeRet ///< [out][optional] pointer to the actual size in + ///< bytes of data being queried by propName. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urKernelGetSubGroupInfo( + ur_kernel_handle_t Kernel, ///< [in] handle of the Kernel object + ur_device_handle_t Device, ///< [in] handle of the Device object + ur_kernel_sub_group_info_t + PropName, ///< [in] name of the SubGroup property to query + size_t PropSize, ///< [in] size of the Kernel SubGroup property value + void *PropValue, ///< [in,out][range(0, propSize)][optional] value of the + ///< Kernel SubGroup property. + size_t *PropSizeRet ///< [out][optional] pointer to the actual size in + ///< bytes of data being queried by propName. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urKernelRetain( + ur_kernel_handle_t Kernel ///< [in] handle for the Kernel to retain +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urKernelRelease( + ur_kernel_handle_t Kernel ///< [in] handle for the Kernel to release +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urKernelSetArgPointer( + ur_kernel_handle_t Kernel, ///< [in] handle of the kernel object + uint32_t ArgIndex, ///< [in] argument index in range [0, num args - 1] + const void *ArgValue ///< [in][optional] SVM pointer to memory location + ///< holding the argument value. If null then argument + ///< value is considered null. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urKernelSetArgPointer( + ur_kernel_handle_t Kernel, ///< [in] handle of the kernel object + uint32_t ArgIndex, ///< [in] argument index in range [0, num args - 1] + size_t ArgSize, ///< [in] size of argument type + const void *ArgValue ///< [in][optional] SVM pointer to memory location + ///< holding the argument value. If null then argument + ///< value is considered null. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urKernelSetExecInfo( + ur_kernel_handle_t Kernel, ///< [in] handle of the kernel object + ur_kernel_exec_info_t PropName, ///< [in] name of the execution attribute + size_t PropSize, ///< [in] size in byte the attribute value + const void *PropValue ///< [in][range(0, propSize)] pointer to memory + ///< location holding the property value. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urKernelSetArgSampler( + ur_kernel_handle_t Kernel, ///< [in] handle of the kernel object + uint32_t ArgIndex, ///< [in] argument index in range [0, num args - 1] + ur_sampler_handle_t ArgValue ///< [in] handle of Sampler object. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urKernelSetArgMemObj( + ur_kernel_handle_t Kernel, ///< [in] handle of the kernel object + uint32_t ArgIndex, ///< [in] argument index in range [0, num args - 1] + ur_mem_handle_t ArgValue ///< [in][optional] handle of Memory object. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urKernelGetNativeHandle( + ur_kernel_handle_t Kernel, ///< [in] handle of the kernel. + ur_native_handle_t + *NativeKernel ///< [out] a pointer to the native handle of the kernel. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urKernelCreateWithNativeHandle( + ur_native_handle_t NativeKernel, ///< [in] the native handle of the kernel. + ur_context_handle_t Context, ///< [in] handle of the context object + ur_kernel_handle_t + *Kernel ///< [out] pointer to the handle of the kernel object created. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urKernelSetSpecializationConstants( + ur_kernel_handle_t Kernel, ///< [in] handle of the kernel object + uint32_t Count, ///< [in] the number of elements in the pSpecConstants array + const ur_specialization_constant_info_t + *SpecConstants ///< [in] array of specialization constant value + ///< descriptions +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} \ No newline at end of file diff --git a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_module.hpp b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_kernel.hpp similarity index 75% rename from sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_module.hpp rename to sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_kernel.hpp index 5b5db40f95188..47e2dec99119a 100644 --- a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_module.hpp +++ b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_kernel.hpp @@ -1,4 +1,4 @@ -//===--------- ur_level_zero_module.hpp - Level Zero Adapter ----------===// +//===--------- ur_level_zero_kernel.hpp - Level Zero Adapter ----------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -9,10 +9,6 @@ #include "ur_level_zero_common.hpp" -struct _ur_module_handle_t : _pi_object { - _ur_module_handle_t() {} -}; - struct _ur_kernel_handle_t : _pi_object { _ur_kernel_handle_t() {} }; diff --git a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_mem.cpp b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_mem.cpp index 0310e895f68d3..3240d438f0d71 100644 --- a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_mem.cpp +++ b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_mem.cpp @@ -7,3 +7,670 @@ //===-----------------------------------------------------------------===// #include "ur_level_zero_mem.hpp" + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferRead( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + ur_mem_handle_t Buffer, ///< [in] handle of the buffer object + bool BlockingRead, ///< [in] indicates blocking (true), non-blocking (false) + size_t Offset, ///< [in] offset in bytes in the buffer object + size_t Size, ///< [in] size in bytes of data being read + void *Dst, ///< [in] pointer to host memory where data is to be read into + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before this command can be executed. If nullptr, + ///< the numEventsInWaitList must be 0, indicating + ///< that this command does not wait on any event to + ///< complete. + ur_event_handle_t *Event ///< [in,out][optional] return an event object that + ///< identifies this particular command instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferWrite( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + ur_mem_handle_t Buffer, ///< [in] handle of the buffer object + bool + BlockingWrite, ///< [in] indicates blocking (true), non-blocking (false) + size_t Offset, ///< [in] offset in bytes in the buffer object + size_t Size, ///< [in] size in bytes of data being written + const void + *Src, ///< [in] pointer to host memory where data is to be written from + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before this command can be executed. If nullptr, + ///< the numEventsInWaitList must be 0, indicating + ///< that this command does not wait on any event to + ///< complete. + ur_event_handle_t *Event ///< [in,out][optional] return an event object that + ///< identifies this particular command instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferReadRect( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + ur_mem_handle_t Buffer, ///< [in] handle of the buffer object + bool BlockingRead, ///< [in] indicates blocking (true), non-blocking (false) + ur_rect_offset_t BufferOffset, ///< [in] 3D offset in the buffer + ur_rect_offset_t HostOffset, ///< [in] 3D offset in the host region + ur_rect_region_t + Region, ///< [in] 3D rectangular region descriptor: width, height, depth + size_t BufferRowPitch, ///< [in] length of each row in bytes in the buffer + ///< object + size_t BufferSlicePitch, ///< [in] length of each 2D slice in bytes in the + ///< buffer object being read + size_t HostRowPitch, ///< [in] length of each row in bytes in the host + ///< memory region pointed by dst + size_t HostSlicePitch, ///< [in] length of each 2D slice in bytes in the + ///< host memory region pointed by dst + void *Dst, ///< [in] pointer to host memory where data is to be read into + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before this command can be executed. If nullptr, + ///< the numEventsInWaitList must be 0, indicating + ///< that this command does not wait on any event to + ///< complete. + ur_event_handle_t *Event ///< [in,out][optional] return an event object that + ///< identifies this particular command instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferWriteRect( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + ur_mem_handle_t Buffer, ///< [in] handle of the buffer object + bool + BlockingWrite, ///< [in] indicates blocking (true), non-blocking (false) + ur_rect_offset_t BufferOffset, ///< [in] 3D offset in the buffer + ur_rect_offset_t HostOffset, ///< [in] 3D offset in the host region + ur_rect_region_t + Region, ///< [in] 3D rectangular region descriptor: width, height, depth + size_t BufferRowPitch, ///< [in] length of each row in bytes in the buffer + ///< object + size_t BufferSlicePitch, ///< [in] length of each 2D slice in bytes in the + ///< buffer object being written + size_t HostRowPitch, ///< [in] length of each row in bytes in the host + ///< memory region pointed by src + size_t HostSlicePitch, ///< [in] length of each 2D slice in bytes in the + ///< host memory region pointed by src + void *Src, ///< [in] pointer to host memory where data is to be written from + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< points to a list of events that must be complete + ///< before this command can be executed. If nullptr, + ///< the numEventsInWaitList must be 0, indicating + ///< that this command does not wait on any event to + ///< complete. + ur_event_handle_t *Event ///< [in,out][optional] return an event object that + ///< identifies this particular command instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferCopy( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + ur_mem_handle_t BufferSrc, ///< [in] handle of the src buffer object + ur_mem_handle_t BufferDst, ///< [in] handle of the dest buffer object + size_t SrcOffset, ///< [in] offset into hBufferSrc to begin copying from + size_t DstOffset, ///< [in] offset info hBufferDst to begin copying into + size_t Size, ///< [in] size in bytes of data being copied + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before this command can be executed. If nullptr, + ///< the numEventsInWaitList must be 0, indicating + ///< that this command does not wait on any event to + ///< complete. + ur_event_handle_t *Event ///< [in,out][optional] return an event object that + ///< identifies this particular command instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferCopyRect( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + ur_mem_handle_t BufferSrc, ///< [in] handle of the source buffer object + ur_mem_handle_t BufferDst, ///< [in] handle of the dest buffer object + ur_rect_offset_t SrcOrigin, ///< [in] 3D offset in the source buffer + ur_rect_offset_t DstOrigin, ///< [in] 3D offset in the destination buffer + ur_rect_region_t SrcRegion, ///< [in] source 3D rectangular region + ///< descriptor: width, height, depth + size_t SrcRowPitch, ///< [in] length of each row in bytes in the source + ///< buffer object + size_t SrcSlicePitch, ///< [in] length of each 2D slice in bytes in the + ///< source buffer object + size_t DstRowPitch, ///< [in] length of each row in bytes in the destination + ///< buffer object + size_t DstSlicePitch, ///< [in] length of each 2D slice in bytes in the + ///< destination buffer object + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before this command can be executed. If nullptr, + ///< the numEventsInWaitList must be 0, indicating + ///< that this command does not wait on any event to + ///< complete. + ur_event_handle_t *Event ///< [in,out][optional] return an event object that + ///< identifies this particular command instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferFill( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + ur_mem_handle_t Buffer, ///< [in] handle of the buffer object + const void *Pattern, ///< [in] pointer to the fill pattern + size_t PatternSize, ///< [in] size in bytes of the pattern + size_t Offset, ///< [in] offset into the buffer + size_t Size, ///< [in] fill size in bytes, must be a multiple of patternSize + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before this command can be executed. If nullptr, + ///< the numEventsInWaitList must be 0, indicating + ///< that this command does not wait on any event to + ///< complete. + ur_event_handle_t *Event ///< [in,out][optional] return an event object that + ///< identifies this particular command instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageRead( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + ur_mem_handle_t Image, ///< [in] handle of the image object + bool BlockingRead, ///< [in] indicates blocking (true), non-blocking (false) + ur_rect_offset_t Origin, ///< [in] defines the (x,y,z) offset in pixels in + ///< the 1D, 2D, or 3D image + ur_rect_region_t Region, ///< [in] defines the (width, height, depth) in + ///< pixels of the 1D, 2D, or 3D image + size_t RowPitch, ///< [in] length of each row in bytes + size_t SlicePitch, ///< [in] length of each 2D slice of the 3D image + void *Dst, ///< [in] pointer to host memory where image is to be read into + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before this command can be executed. If nullptr, + ///< the numEventsInWaitList must be 0, indicating + ///< that this command does not wait on any event to + ///< complete. + ur_event_handle_t *Event ///< [in,out][optional] return an event object that + ///< identifies this particular command instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageWrite( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + ur_mem_handle_t Image, ///< [in] handle of the image object + bool + BlockingWrite, ///< [in] indicates blocking (true), non-blocking (false) + ur_rect_offset_t Origin, ///< [in] defines the (x,y,z) offset in pixels in + ///< the 1D, 2D, or 3D image + ur_rect_region_t Region, ///< [in] defines the (width, height, depth) in + ///< pixels of the 1D, 2D, or 3D image + size_t InputRowPitch, ///< [in] length of each row in bytes + size_t InputSlicePitch, ///< [in] length of each 2D slice of the 3D image + void *Src, ///< [in] pointer to host memory where image is to be read into + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before this command can be executed. If nullptr, + ///< the numEventsInWaitList must be 0, indicating + ///< that this command does not wait on any event to + ///< complete. + ur_event_handle_t *Event ///< [in,out][optional] return an event object that + ///< identifies this particular command instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageCopy( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + ur_mem_handle_t ImageSrc, ///< [in] handle of the src image object + ur_mem_handle_t ImageDst, ///< [in] handle of the dest image object + ur_rect_offset_t SrcOrigin, ///< [in] defines the (x,y,z) offset in pixels + ///< in the source 1D, 2D, or 3D image + ur_rect_offset_t DstOrigin, ///< [in] defines the (x,y,z) offset in pixels + ///< in the destination 1D, 2D, or 3D image + ur_rect_region_t Region, ///< [in] defines the (width, height, depth) in + ///< pixels of the 1D, 2D, or 3D image + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before this command can be executed. If nullptr, + ///< the numEventsInWaitList must be 0, indicating + ///< that this command does not wait on any event to + ///< complete. + ur_event_handle_t *Event ///< [in,out][optional] return an event object that + ///< identifies this particular command instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferMap( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + ur_mem_handle_t Buffer, ///< [in] handle of the buffer object + bool BlockingMap, ///< [in] indicates blocking (true), non-blocking (false) + ur_map_flags_t MapFlags, ///< [in] flags for read, write, readwrite mapping + size_t Offset, ///< [in] offset in bytes of the buffer region being mapped + size_t Size, ///< [in] size in bytes of the buffer region being mapped + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before this command can be executed. If nullptr, + ///< the numEventsInWaitList must be 0, indicating + ///< that this command does not wait on any event to + ///< complete. + ur_event_handle_t + *Event, ///< [in,out][optional] return an event object that identifies + ///< this particular command instance. + void **RetMap ///< [in,out] return mapped pointer. TODO: move it before + ///< numEventsInWaitList? +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemUnmap( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + ur_mem_handle_t Mem, ///< [in] handle of the memory (buffer or image) object + void *MappedPtr, ///< [in] mapped host address + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before this command can be executed. If nullptr, + ///< the numEventsInWaitList must be 0, indicating + ///< that this command does not wait on any event to + ///< complete. + ur_event_handle_t *Event ///< [in,out][optional] return an event object that + ///< identifies this particular command instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMMemset( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + void *Ptr, ///< [in] pointer to USM memory object + int8_t ByteValue, ///< [in] byte value to fill + size_t Count, ///< [in] size in bytes to be set + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before this command can be executed. If nullptr, + ///< the numEventsInWaitList must be 0, indicating + ///< that this command does not wait on any event to + ///< complete. + ur_event_handle_t *Event ///< [in,out][optional] return an event object that + ///< identifies this particular command instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMMemcpy( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + bool Blocking, ///< [in] blocking or non-blocking copy + void *Dst, ///< [in] pointer to the destination USM memory object + const void *Src, ///< [in] pointer to the source USM memory object + size_t size, ///< [in] size in bytes to be copied + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before this command can be executed. If nullptr, + ///< the numEventsInWaitList must be 0, indicating + ///< that this command does not wait on any event to + ///< complete. + ur_event_handle_t *Event ///< [in,out][optional] return an event object that + ///< identifies this particular command instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMPrefetch( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + const void *Mem, ///< [in] pointer to the USM memory object + size_t size, ///< [in] size in bytes to be fetched + ur_usm_migration_flags_t Flags, ///< [in] USM prefetch flags + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before this command can be executed. If nullptr, + ///< the numEventsInWaitList must be 0, indicating + ///< that this command does not wait on any event to + ///< complete. + ur_event_handle_t *Event ///< [in,out][optional] return an event object that + ///< identifies this particular command instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMMemAdvise( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + const void *Mem, ///< [in] pointer to the USM memory object + size_t Size, ///< [in] size in bytes to be advised + ur_mem_advice_t Advice, ///< [in] USM memory advice + ur_event_handle_t *Event ///< [in,out][optional] return an event object that + ///< identifies this particular command instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMFill2D( + ur_queue_handle_t Queue, ///< [in] handle of the queue to submit to. + void *Mem, ///< [in] pointer to memory to be filled. + size_t Pitch, ///< [in] the total width of the destination memory including + ///< padding. + size_t PatternSize, ///< [in] the size in bytes of the pattern. + const void *Pattern, ///< [in] pointer with the bytes of the pattern to set. + size_t Width, ///< [in] the width in bytes of each row to fill. + size_t Height, ///< [in] the height of the columns to fill. + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before the kernel execution. If nullptr, the + ///< numEventsInWaitList must be 0, indicating that no + ///< wait event. + ur_event_handle_t + *Event ///< [in,out][optional] return an event object that identifies + ///< this particular kernel execution instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMMemset2D( + ur_queue_handle_t Queue, ///< [in] handle of the queue to submit to. + void *pMem, ///< [in] pointer to memory to be filled. + size_t pitch, ///< [in] the total width of the destination memory including + ///< padding. + int value, ///< [in] the value to fill into the region in pMem. + size_t width, ///< [in] the width in bytes of each row to set. + size_t height, ///< [in] the height of the columns to set. + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before the kernel execution. If nullptr, the + ///< numEventsInWaitList must be 0, indicating that no + ///< wait event. + ur_event_handle_t + *Event ///< [in,out][optional] return an event object that identifies + ///< this particular kernel execution instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMMemcpy2D( + ur_queue_handle_t Queue, ///< [in] handle of the queue to submit to. + bool Blocking, ///< [in] indicates if this operation should block the host. + void *Dst, ///< [in] pointer to memory where data will be copied. + size_t DstPitch, ///< [in] the total width of the source memory including + ///< padding. + const void *Src, ///< [in] pointer to memory to be copied. + size_t SrcPitch, ///< [in] the total width of the source memory including + ///< padding. + size_t Width, ///< [in] the width in bytes of each row to be copied. + size_t Height, ///< [in] the height of columns to be copied. + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t + *EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before the kernel execution. If nullptr, the + ///< numEventsInWaitList must be 0, indicating that no + ///< wait event. + ur_event_handle_t + *Event ///< [in,out][optional] return an event object that identifies + ///< this particular kernel execution instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urMemImageCreate( + ur_context_handle_t Context, ///< [in] handle of the context object + ur_mem_flags_t Flags, ///< [in] allocation and usage information flags + const ur_image_format_t + *ImageFormat, ///< [in] pointer to image format specification + const ur_image_desc_t *ImageDesc, ///< [in] pointer to image description + void *Host, ///< [in] pointer to the buffer data + ur_mem_handle_t *Mem ///< [out] pointer to handle of image object created +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urMemBufferCreate( + ur_context_handle_t Context, ///< [in] handle of the context object + ur_mem_flags_t Flags, ///< [in] allocation and usage information flags + size_t Size, ///< [in] size in bytes of the memory object to be allocated + void *Host, ///< [in][optional] pointer to the buffer data + ur_mem_handle_t + *Buffer ///< [out] pointer to handle of the memory buffer created +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urMemRetain( + ur_mem_handle_t Mem ///< [in] handle of the memory object to get access +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urMemRelease( + ur_mem_handle_t Mem ///< [in] handle of the memory object to release +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urMemBufferPartition( + ur_mem_handle_t + Buffer, ///< [in] handle of the buffer object to allocate from + ur_mem_flags_t Flags, ///< [in] allocation and usage information flags + ur_buffer_create_type_t BufferCreateType, ///< [in] buffer creation type + ur_buffer_region_t + *BufferCreateInfo, ///< [in] pointer to buffer create region information + ur_mem_handle_t *Mem ///< [out] pointer to the handle of sub buffer created +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urMemGetNativeHandle( + ur_mem_handle_t Mem, ///< [in] handle of the mem. + ur_native_handle_t + *NativeMem ///< [out] a pointer to the native handle of the mem. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urMemCreateWithNativeHandle( + ur_native_handle_t NativeMem, ///< [in] the native handle of the mem. + ur_context_handle_t Context, ///< [in] handle of the context object + ur_mem_handle_t + *Mem ///< [out] pointer to the handle of the mem object created. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urMemGetInfo( + ur_mem_handle_t Memory, ///< [in] handle to the memory object being queried. + ur_mem_info_t MemInfoType, ///< [in] type of the info to retrieve. + size_t PropSize, ///< [in] the number of bytes of memory pointed to by + ///< pMemInfo. + void *MemInfo, ///< [out][optional] array of bytes holding the info. + ///< If propSize is less than the real number of bytes + ///< needed to return the info then the + ///< ::UR_RESULT_ERROR_INVALID_SIZE error is returned and + ///< pMemInfo is not used. + size_t *PropSizeRet ///< [out][optional] pointer to the actual size in + ///< bytes of data queried by pMemInfo. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urMemImageGetInfo( + ur_mem_handle_t Memory, ///< [in] handle to the image object being queried. + ur_image_info_t ImgInfoType, ///< [in] type of image info to retrieve. + size_t PropSize, ///< [in] the number of bytes of memory pointer to by + ///< pImgInfo. + void *ImgInfo, ///< [out][optional] array of bytes holding the info. + ///< If propSize is less than the real number of bytes + ///< needed to return the info then the + ///< ::UR_RESULT_ERROR_INVALID_SIZE error is returned and + ///< pImgInfo is not used. + size_t *PropSizeRet ///< [out][optional] pointer to the actual size in + ///< bytes of data queried by pImgInfo. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urUSMHostAlloc( + ur_context_handle_t Context, ///< [in] handle of the context object + ur_usm_desc_t *USMDesc, ///< [in][optional] USM memory allocation descriptor + ur_usm_pool_handle_t Pool, ///< [in][optional] Pointer to a pool created + ///< using urUSMPoolCreate + size_t + Size, ///< [in] size in bytes of the USM memory object to be allocated + uint32_t Align, ///< [in] alignment of the USM memory object + void **RetMem ///< [out] pointer to USM host memory object +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urUSMDeviceAlloc( + ur_context_handle_t Context, ///< [in] handle of the context object + ur_device_handle_t Device, ///< [in] handle of the device object + ur_usm_desc_t *USMDesc, ///< [in][optional] USM memory allocation descriptor + ur_usm_pool_handle_t Pool, ///< [in][optional] Pointer to a pool created + ///< using urUSMPoolCreate + size_t + Size, ///< [in] size in bytes of the USM memory object to be allocated + uint32_t Alignment, ///< [in] alignment of the USM memory object + void **RetMem ///< [out] pointer to USM device memory object +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urUSMSharedAlloc( + ur_context_handle_t Context, ///< [in] handle of the context object + ur_device_handle_t Device, ///< [in] handle of the device object + ur_usm_desc_t *USMDesc, ///< [in][optional] USM memory allocation descriptor + ur_usm_pool_handle_t Pool, ///< [in][optional] Pointer to a pool created + ///< using urUSMPoolCreate + size_t + Size, ///< [in] size in bytes of the USM memory object to be allocated + uint32_t Alignment, ///< [in] alignment of the USM memory object + void **RetMem ///< [out] pointer to USM shared memory object +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urUSMFree( + ur_context_handle_t Context, ///< [in] handle of the context object + void *Mem ///< [in] pointer to USM memory object +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urUSMGetMemAllocInfo( + ur_context_handle_t Context, ///< [in] handle of the context object + const void *Mem, ///< [in] pointer to USM memory object + ur_usm_alloc_info_t + PropName, ///< [in] the name of the USM allocation property to query + size_t PropValueSize, ///< [in] size in bytes of the USM allocation property + ///< value + void *PropValue, ///< [out][optional] value of the USM allocation property + size_t *PropValueSizeRet ///< [out][optional] bytes returned in USM + ///< allocation property +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolCreate( + ur_context_handle_t Context, ///< [in] handle of the context object + ur_usm_pool_desc_t + *PoolDesc, ///< [in] pointer to USM pool descriptor. Can be chained with + ///< ::ur_usm_pool_limits_desc_t + ur_usm_pool_handle_t *Pool ///< [out] pointer to USM memory pool +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolDestroy( + ur_context_handle_t Context, ///< [in] handle of the context object + ur_usm_pool_handle_t Pool ///< [in] pointer to USM memory pool +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMFill( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + void *Ptr, ///< [in] pointer to USM memory object + size_t PatternSize, ///< [in] the size in bytes of the pattern. Must be a + ///< power of 2 and less than or equal to width. + const void *Pattern, ///< [in] pointer with the bytes of the pattern to set. + size_t Size, ///< [in] size in bytes to be set. Must be a multiple of + ///< patternSize. + uint32_t NumEventsInWaitList, ///< [in] size of the event wait list + const ur_event_handle_t * + EventWaitList, ///< [in][optional][range(0, numEventsInWaitList)] + ///< pointer to a list of events that must be complete + ///< before this command can be executed. If nullptr, the + ///< numEventsInWaitList must be 0, indicating that this + ///< command does not wait on any event to complete. + ur_event_handle_t *Event ///< [out][optional] return an event object that + ///< identifies this particular command instance. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} \ No newline at end of file diff --git a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_module.cpp b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_module.cpp deleted file mode 100644 index 22476938ac884..0000000000000 --- a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_module.cpp +++ /dev/null @@ -1,9 +0,0 @@ -//===--------- ur_level_zero_module.cpp - Level Zero Adapter ----------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===-----------------------------------------------------------------===// - -#include "ur_level_zero_module.hpp" diff --git a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_platform.cpp b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_platform.cpp index 99fab2d48dc16..c83e9ce3b044b 100644 --- a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_platform.cpp +++ b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_platform.cpp @@ -7,3 +7,56 @@ //===-----------------------------------------------------------------===// #include "ur_level_zero_platform.hpp" + +UR_APIEXPORT ur_result_t UR_APICALL urInit( + ur_device_init_flags_t + DeviceFlags ///< [in] device initialization flags. + ///< must be 0 (default) or a combination of + ///< ::ur_device_init_flag_t. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urTearDown( + void *Params ///< [in] pointer to tear down parameters +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urPlatformGetApiVersion( + ur_platform_handle_t Driver, ///< [in] handle of the platform + ur_api_version_t *Version ///< [out] api version +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urPlatformGetNativeHandle( + ur_platform_handle_t Platform, ///< [in] handle of the platform. + ur_native_handle_t *NativePlatform ///< [out] a pointer to the native + ///< handle of the platform. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urPlatformCreateWithNativeHandle( + ur_native_handle_t + NativePlatform, ///< [in] the native handle of the platform. + ur_platform_handle_t *Platform ///< [out] pointer to the handle of the + ///< platform object created. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urGetLastResult( + ur_platform_handle_t Platform, ///< [in] handle of the platform instance + const char **Message ///< [out] pointer to a string containing adapter + ///< specific result in string representation. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} diff --git a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_program.cpp b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_program.cpp index ff45091ce6795..057a4a7229a08 100644 --- a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_program.cpp +++ b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_program.cpp @@ -7,3 +7,186 @@ //===-----------------------------------------------------------------===// #include "ur_level_zero_program.hpp" + +UR_APIEXPORT ur_result_t UR_APICALL urProgramCreateWithIL( + ur_context_handle_t Context, ///< [in] handle of the context instance + const void *IL, ///< [in] pointer to IL binary. + size_t Length, ///< [in] length of `pIL` in bytes. + const ur_program_properties_t + *Properties, ///< [in][optional] pointer to program creation properties. + ur_program_handle_t + *Program ///< [out] pointer to handle of program object created. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urProgramCreateWithBinary( + ur_context_handle_t Context, ///< [in] handle of the context instance + ur_device_handle_t + Device, ///< [in] handle to device associated with binary. + size_t Size, ///< [in] size in bytes. + const uint8_t *Binary, ///< [in] pointer to binary. + const ur_program_properties_t + *Properties, ///< [in][optional] pointer to program creation properties. + ur_program_handle_t + *Program ///< [out] pointer to handle of Program object created. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urProgramBuild( + ur_context_handle_t Context, ///< [in] handle of the context instance. + ur_program_handle_t Program, ///< [in] Handle of the program to build. + const char *Options ///< [in][optional] pointer to build options + ///< null-terminated string. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urProgramCompile( + ur_context_handle_t Context, ///< [in] handle of the context instance. + ur_program_handle_t + Program, ///< [in][out] handle of the program to compile. + const char *Options ///< [in][optional] pointer to build options + ///< null-terminated string. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urProgramLink( + ur_context_handle_t Context, ///< [in] handle of the context instance. + uint32_t Count, ///< [in] number of program handles in `phPrograms`. + const ur_program_handle_t *Programs, ///< [in][range(0, count)] pointer to + ///< array of program handles. + const char *Options, ///< [in][optional] pointer to linker options + ///< null-terminated string. + ur_program_handle_t + *Program ///< [out] pointer to handle of program object created. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urProgramCreateWithBinary( + ur_context_handle_t Context, ///< [in] handle of the context instance + ur_device_handle_t + Device, ///< [in] handle to device associated with binary. + size_t Size, ///< [in] size in bytes. + const uint8_t *Binary, ///< [in] pointer to binary. + ur_program_handle_t + *Program ///< [out] pointer to handle of Program object created. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urProgramRetain( + ur_program_handle_t Program ///< [in] handle for the Program to retain +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urProgramRelease( + ur_program_handle_t Program ///< [in] handle for the Program to release +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urProgramGetFunctionPointer( + ur_device_handle_t + Device, ///< [in] handle of the device to retrieve pointer for. + ur_program_handle_t + Program, ///< [in] handle of the program to search for function in. + ///< The program must already be built to the specified + ///< device, or otherwise + ///< ::UR_RESULT_ERROR_INVALID_PROGRAM_EXECUTABLE is returned. + const char *FunctionName, ///< [in] A null-terminates string denoting the + ///< mangled function name. + void **FunctionPointer ///< [out] Returns the pointer to the function if + ///< it is found in the program. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urProgramGetInfo( + ur_program_handle_t Program, ///< [in] handle of the Program object + ur_program_info_t PropName, ///< [in] name of the Program property to query + size_t PropSize, ///< [in] the size of the Program property. + void *ProgramInfo, ///< [in,out][optional] array of bytes of holding the + ///< program info property. If propSize is not equal to + ///< or greater than the real number of bytes needed to + ///< return the info then the + ///< ::UR_RESULT_ERROR_INVALID_SIZE error is returned + ///< and pProgramInfo is not used. + size_t *PropSizeRet ///< [out][optional] pointer to the actual size in + ///< bytes of data copied to propName. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urProgramGetBuildInfo( + ur_program_handle_t Program, ///< [in] handle of the Program object + ur_device_handle_t Device, ///< [in] handle of the Device object + ur_program_build_info_t + PropName, ///< [in] name of the Program build info to query + size_t PropSize, ///< [in] size of the Program build info property. + void *PropValue, ///< [in,out][optional] value of the Program build + ///< property. If propSize is not equal to or greater than + ///< the real number of bytes needed to return the info + ///< then the ::UR_RESULT_ERROR_INVALID_SIZE error is + ///< returned and pKernelInfo is not used. + size_t *PropSizeRet ///< [out][optional] pointer to the actual size in + ///< bytes of data being queried by propName. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urProgramSetSpecializationConstant( + ur_program_handle_t Program, ///< [in] handle of the Program object + uint32_t SpecId, ///< [in] specification constant Id + size_t SpecSize, ///< [in] size of the specialization constant value + const void *SpecValue ///< [in] pointer to the specialization value bytes +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urProgramGetNativeHandle( + ur_program_handle_t Program, ///< [in] handle of the program. + ur_native_handle_t *NativeProgram ///< [out] a pointer to the native + ///< handle of the program. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urProgramCreateWithNativeHandle( + ur_native_handle_t + NativeProgram, ///< [in] the native handle of the program. + ur_context_handle_t Context, ///< [in] handle of the context instance + ur_program_handle_t *Program ///< [out] pointer to the handle of the + ///< program object created. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urProgramSetSpecializationConstants( + ur_program_handle_t Program, ///< [in] handle of the Program object + uint32_t Count, ///< [in] the number of elements in the pSpecConstants array + const ur_specialization_constant_info_t + *SpecConstants ///< [in][range(0, count)] array of specialization + ///< constant value descriptions +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} \ No newline at end of file diff --git a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_queue.cpp b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_queue.cpp index 8838bb74269bf..fbdd3fae302d6 100644 --- a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_queue.cpp +++ b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_queue.cpp @@ -7,3 +7,79 @@ //===-----------------------------------------------------------------===// #include "ur_level_zero_queue.hpp" + +UR_APIEXPORT ur_result_t UR_APICALL urQueueGetInfo( + ur_queue_handle_t Queue, ///< [in] handle of the queue object + ur_queue_info_t PropName, ///< [in] name of the queue property to query + size_t PropValueSize, ///< [in] size in bytes of the queue property value + ///< provided + void *PropValue, ///< [out] value of the queue property + size_t + *PropSizeRet ///< [out] size in bytes returned in queue property value +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urQueueCreate( + ur_context_handle_t Context, ///< [in] handle of the context object + ur_device_handle_t Device, ///< [in] handle of the device object + const ur_queue_property_t + *Props, ///< [in] specifies a list of queue properties and their + ///< corresponding values. Each property name is immediately + ///< followed by the corresponding desired value. The list is + ///< terminated with a 0. If a property value is not specified, + ///< then its default value will be used. + ur_queue_handle_t + *Queue ///< [out] pointer to handle of queue object created +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urQueueRetain( + ur_queue_handle_t Queue ///< [in] handle of the queue object to get access +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urQueueRelease( + ur_queue_handle_t Queue ///< [in] handle of the queue object to release +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urQueueGetNativeHandle( + ur_queue_handle_t Queue, ///< [in] handle of the queue. + ur_native_handle_t + *NativeQueue ///< [out] a pointer to the native handle of the queue. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urQueueCreateWithNativeHandle( + ur_native_handle_t NativeQueue, ///< [in] the native handle of the queue. + ur_context_handle_t Context, ///< [in] handle of the context object + ur_queue_handle_t + *Queue ///< [out] pointer to the handle of the queue object created. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urQueueFinish( + ur_queue_handle_t Queue ///< [in] handle of the queue to be finished. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urQueueFlush( + ur_queue_handle_t Queue ///< [in] handle of the queue to be flushed. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} diff --git a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_sampler.cpp b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_sampler.cpp index 7014f92ddfb90..2f97fe75921fa 100644 --- a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_sampler.cpp +++ b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_level_zero_sampler.cpp @@ -7,3 +7,64 @@ //===-----------------------------------------------------------------===// #include "ur_level_zero_sampler.hpp" + +UR_APIEXPORT ur_result_t UR_APICALL urSamplerCreate( + ur_context_handle_t Context, ///< [in] handle of the context object + const ur_sampler_property_t + *Props, ///< [in] specifies a list of sampler property names and their + ///< corresponding values. + ur_sampler_handle_t + *Sampler ///< [out] pointer to handle of sampler object created +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urSamplerRetain( + ur_sampler_handle_t + Sampler ///< [in] handle of the sampler object to get access +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urSamplerRelease( + ur_sampler_handle_t + Sampler ///< [in] handle of the sampler object to release +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urSamplerGetInfo( + ur_sampler_handle_t Sampler, ///< [in] handle of the sampler object + ur_sampler_info_t PropName, ///< [in] name of the sampler property to query + size_t PropValueSize, ///< [in] size in bytes of the sampler property value + ///< provided + void *PropValue, ///< [out] value of the sampler property + size_t + *PropSizeRet ///< [out] size in bytes returned in sampler property value +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urSamplerGetNativeHandle( + ur_sampler_handle_t Sampler, ///< [in] handle of the sampler. + ur_native_handle_t *NativeSampler ///< [out] a pointer to the native + ///< handle of the sampler. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + +UR_APIEXPORT ur_result_t UR_APICALL urSamplerCreateWithNativeHandle( + ur_native_handle_t + NativeSampler, ///< [in] the native handle of the sampler. + ur_context_handle_t Context, ///< [in] handle of the context object + ur_sampler_handle_t *Sampler ///< [out] pointer to the handle of the + ///< sampler object created. +) { + urPrint("[UR][L0] %s function not implemented!\n", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} diff --git a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_loader_interface.cpp b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_loader_interface.cpp index cc6e727a43df1..a117de71b57e6 100644 --- a/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_loader_interface.cpp +++ b/sycl/plugins/unified_runtime/ur/adapters/level_zero/ur_loader_interface.cpp @@ -32,7 +32,7 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetGlobalProcAddrTable( } pDdiTable->pfnInit = urInit; - pDdiTable->pfnGetLastResult = nullptr; + pDdiTable->pfnGetLastResult = urGetLastResult; pDdiTable->pfnTearDown = urTearDown; return retVal; @@ -48,13 +48,13 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetContextProcAddrTable( return retVal; } - pDdiTable->pfnCreate = nullptr; - pDdiTable->pfnRetain = nullptr; - pDdiTable->pfnRelease = nullptr; - pDdiTable->pfnGetInfo = nullptr; - pDdiTable->pfnGetNativeHandle = nullptr; - pDdiTable->pfnCreateWithNativeHandle = nullptr; - pDdiTable->pfnSetExtendedDeleter = nullptr; + pDdiTable->pfnCreate = urContextCreate; + pDdiTable->pfnRetain = urContextRetain; + pDdiTable->pfnRelease = urContextRelease; + pDdiTable->pfnGetInfo = urContextGetInfo; + pDdiTable->pfnGetNativeHandle = urContextGetNativeHandle; + pDdiTable->pfnCreateWithNativeHandle = urContextCreateWithNativeHandle; + pDdiTable->pfnSetExtendedDeleter = urContextSetExtendedDeleter; return retVal; } @@ -69,28 +69,29 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetEnqueueProcAddrTable( return retVal; } - pDdiTable->pfnKernelLaunch = nullptr; - pDdiTable->pfnEventsWait = nullptr; - pDdiTable->pfnEventsWaitWithBarrier = nullptr; - pDdiTable->pfnMemBufferRead = nullptr; - pDdiTable->pfnMemBufferWrite = nullptr; - pDdiTable->pfnMemBufferReadRect = nullptr; - pDdiTable->pfnMemBufferWriteRect = nullptr; - pDdiTable->pfnMemBufferCopy = nullptr; - pDdiTable->pfnMemBufferCopyRect = nullptr; - pDdiTable->pfnMemBufferFill = nullptr; - pDdiTable->pfnMemImageRead = nullptr; - pDdiTable->pfnMemImageWrite = nullptr; - pDdiTable->pfnMemImageCopy = nullptr; - pDdiTable->pfnMemBufferMap = nullptr; - pDdiTable->pfnMemUnmap = nullptr; - pDdiTable->pfnUSMMemcpy = nullptr; - pDdiTable->pfnUSMPrefetch = nullptr; - pDdiTable->pfnUSMMemAdvise = nullptr; - pDdiTable->pfnUSMFill2D = nullptr; - pDdiTable->pfnUSMMemcpy2D = nullptr; - pDdiTable->pfnDeviceGlobalVariableWrite = nullptr; - pDdiTable->pfnDeviceGlobalVariableRead = nullptr; + pDdiTable->pfnKernelLaunch = urEnqueueKernelLaunch; + pDdiTable->pfnEventsWait = urEnqueueEventsWait; + pDdiTable->pfnEventsWaitWithBarrier = urEnqueueEventsWaitWithBarrier; + pDdiTable->pfnMemBufferRead = urEnqueueMemBufferRead; + pDdiTable->pfnMemBufferWrite = urEnqueueMemBufferWrite; + pDdiTable->pfnMemBufferReadRect = urEnqueueMemBufferReadRect; + pDdiTable->pfnMemBufferWriteRect = urEnqueueMemBufferWriteRect; + pDdiTable->pfnMemBufferCopy = urEnqueueMemBufferCopy; + pDdiTable->pfnMemBufferCopyRect = urEnqueueMemBufferCopyRect; + pDdiTable->pfnMemBufferFill = urEnqueueMemBufferFill; + pDdiTable->pfnMemImageRead = urEnqueueMemImageRead; + pDdiTable->pfnMemImageWrite = urEnqueueMemImageWrite; + pDdiTable->pfnMemImageCopy = urEnqueueMemImageCopy; + pDdiTable->pfnMemBufferMap = urEnqueueMemBufferMap; + pDdiTable->pfnMemUnmap = urEnqueueMemUnmap; + pDdiTable->pfnUSMFill = urEnqueueUSMFill; + pDdiTable->pfnUSMMemcpy = urEnqueueUSMMemcpy; + pDdiTable->pfnUSMPrefetch = urEnqueueUSMPrefetch; + pDdiTable->pfnUSMMemAdvise = urEnqueueUSMMemAdvise; + pDdiTable->pfnUSMFill2D = urEnqueueUSMFill2D; + pDdiTable->pfnUSMMemcpy2D = urEnqueueUSMMemcpy2D; + pDdiTable->pfnDeviceGlobalVariableWrite = urEnqueueDeviceGlobalVariableWrite; + pDdiTable->pfnDeviceGlobalVariableRead = urEnqueueDeviceGlobalVariableRead; return retVal; } @@ -104,14 +105,14 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetEventProcAddrTable( if (UR_RESULT_SUCCESS != retVal) { return retVal; } - pDdiTable->pfnGetInfo = nullptr; - pDdiTable->pfnGetProfilingInfo = nullptr; - pDdiTable->pfnWait = nullptr; - pDdiTable->pfnRetain = nullptr; - pDdiTable->pfnRelease = nullptr; - pDdiTable->pfnGetNativeHandle = nullptr; - pDdiTable->pfnCreateWithNativeHandle = nullptr; - pDdiTable->pfnSetCallback = nullptr; + pDdiTable->pfnGetInfo = urEventGetInfo; + pDdiTable->pfnGetProfilingInfo = urEventGetProfilingInfo; + pDdiTable->pfnWait = urEventWait; + pDdiTable->pfnRetain = urEventRetain; + pDdiTable->pfnRelease = urEventRelease; + pDdiTable->pfnGetNativeHandle = urEventGetNativeHandle; + pDdiTable->pfnCreateWithNativeHandle = urEventCreateWithNativeHandle; + pDdiTable->pfnSetCallback = urEventSetCallback; return retVal; } @@ -125,20 +126,21 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetKernelProcAddrTable( if (UR_RESULT_SUCCESS != retVal) { return retVal; } - pDdiTable->pfnCreate = nullptr; - pDdiTable->pfnGetInfo = nullptr; - pDdiTable->pfnGetGroupInfo = nullptr; - pDdiTable->pfnGetSubGroupInfo = nullptr; - pDdiTable->pfnRetain = nullptr; - pDdiTable->pfnRelease = nullptr; - pDdiTable->pfnGetNativeHandle = nullptr; - pDdiTable->pfnCreateWithNativeHandle = nullptr; - pDdiTable->pfnSetArgValue = nullptr; - pDdiTable->pfnSetArgLocal = nullptr; - pDdiTable->pfnSetArgPointer = nullptr; - pDdiTable->pfnSetExecInfo = nullptr; - pDdiTable->pfnSetArgSampler = nullptr; - pDdiTable->pfnSetArgMemObj = nullptr; + pDdiTable->pfnCreate = urKernelCreate; + pDdiTable->pfnGetInfo = urKernelGetInfo; + pDdiTable->pfnGetGroupInfo = urKernelGetGroupInfo; + pDdiTable->pfnGetSubGroupInfo = urKernelGetSubGroupInfo; + pDdiTable->pfnRetain = urKernelRetain; + pDdiTable->pfnRelease = urKernelRelease; + pDdiTable->pfnGetNativeHandle = urKernelGetNativeHandle; + pDdiTable->pfnCreateWithNativeHandle = urKernelCreateWithNativeHandle; + pDdiTable->pfnSetArgValue = urKernelSetArgValue; + pDdiTable->pfnSetArgLocal = urKernelSetArgLocal; + pDdiTable->pfnSetArgPointer = urKernelSetArgPointer; + pDdiTable->pfnSetExecInfo = urKernelSetExecInfo; + pDdiTable->pfnSetArgSampler = urKernelSetArgSampler; + pDdiTable->pfnSetArgMemObj = urKernelSetArgMemObj; + pDdiTable->pfnSetSpecializationConstants = urKernelSetSpecializationConstants; return retVal; } @@ -151,15 +153,15 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetMemProcAddrTable( if (UR_RESULT_SUCCESS != retVal) { return retVal; } - pDdiTable->pfnImageCreate = nullptr; - pDdiTable->pfnBufferCreate = nullptr; - pDdiTable->pfnRetain = nullptr; - pDdiTable->pfnRelease = nullptr; - pDdiTable->pfnBufferPartition = nullptr; - pDdiTable->pfnGetNativeHandle = nullptr; - pDdiTable->pfnCreateWithNativeHandle = nullptr; - pDdiTable->pfnGetInfo = nullptr; - pDdiTable->pfnImageGetInfo = nullptr; + pDdiTable->pfnImageCreate = urMemImageCreate; + pDdiTable->pfnBufferCreate = urMemBufferCreate; + pDdiTable->pfnRetain = urMemRetain; + pDdiTable->pfnRelease = urMemRelease; + pDdiTable->pfnBufferPartition = urMemBufferPartition; + pDdiTable->pfnGetNativeHandle = urMemGetNativeHandle; + pDdiTable->pfnCreateWithNativeHandle = urMemCreateWithNativeHandle; + pDdiTable->pfnGetInfo = urMemGetInfo; + pDdiTable->pfnImageGetInfo = urMemImageGetInfo; return retVal; } @@ -175,9 +177,9 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetPlatformProcAddrTable( } pDdiTable->pfnGet = urPlatformGet; pDdiTable->pfnGetInfo = urPlatformGetInfo; - pDdiTable->pfnGetNativeHandle = nullptr; - pDdiTable->pfnCreateWithNativeHandle = nullptr; - pDdiTable->pfnGetApiVersion = nullptr; + pDdiTable->pfnGetNativeHandle = urPlatformGetNativeHandle; + pDdiTable->pfnCreateWithNativeHandle = urPlatformCreateWithNativeHandle; + pDdiTable->pfnGetApiVersion = urPlatformGetApiVersion; return retVal; } @@ -192,14 +194,20 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetProgramProcAddrTable( if (UR_RESULT_SUCCESS != retVal) { return retVal; } - pDdiTable->pfnCreateWithBinary = nullptr; - pDdiTable->pfnRetain = nullptr; - pDdiTable->pfnRelease = nullptr; - pDdiTable->pfnGetFunctionPointer = nullptr; - pDdiTable->pfnGetInfo = nullptr; - pDdiTable->pfnGetBuildInfo = nullptr; - pDdiTable->pfnGetNativeHandle = nullptr; - pDdiTable->pfnCreateWithNativeHandle = nullptr; + pDdiTable->pfnCreateWithIL = urProgramCreateWithIL; + pDdiTable->pfnCreateWithBinary = urProgramCreateWithBinary; + pDdiTable->pfnBuild = urProgramBuild; + pDdiTable->pfnCompile = urProgramCompile; + pDdiTable->pfnLink = urProgramLink; + pDdiTable->pfnRetain = urProgramRetain; + pDdiTable->pfnRelease = urProgramRelease; + pDdiTable->pfnGetFunctionPointer = urProgramGetFunctionPointer; + pDdiTable->pfnGetInfo = urProgramGetInfo; + pDdiTable->pfnGetBuildInfo = urProgramGetBuildInfo; + pDdiTable->pfnSetSpecializationConstants = + urProgramSetSpecializationConstants; + pDdiTable->pfnGetNativeHandle = urProgramGetNativeHandle; + pDdiTable->pfnCreateWithNativeHandle = urProgramCreateWithNativeHandle; return retVal; } @@ -214,14 +222,14 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetQueueProcAddrTable( return retVal; } - pDdiTable->pfnGetInfo = nullptr; - pDdiTable->pfnCreate = nullptr; - pDdiTable->pfnRetain = nullptr; - pDdiTable->pfnRelease = nullptr; - pDdiTable->pfnGetNativeHandle = nullptr; - pDdiTable->pfnCreateWithNativeHandle = nullptr; - pDdiTable->pfnFinish = nullptr; - pDdiTable->pfnFlush = nullptr; + pDdiTable->pfnGetInfo = urQueueGetInfo; + pDdiTable->pfnCreate = urQueueCreate; + pDdiTable->pfnRetain = urQueueRetain; + pDdiTable->pfnRelease = urQueueRelease; + pDdiTable->pfnGetNativeHandle = urQueueGetNativeHandle; + pDdiTable->pfnCreateWithNativeHandle = urQueueCreateWithNativeHandle; + pDdiTable->pfnFinish = urQueueFinish; + pDdiTable->pfnFlush = urQueueFlush; return retVal; } @@ -235,12 +243,12 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetSamplerProcAddrTable( if (UR_RESULT_SUCCESS != retVal) { return retVal; } - pDdiTable->pfnCreate = nullptr; - pDdiTable->pfnRetain = nullptr; - pDdiTable->pfnRelease = nullptr; - pDdiTable->pfnGetInfo = nullptr; - pDdiTable->pfnGetNativeHandle = nullptr; - pDdiTable->pfnCreateWithNativeHandle = nullptr; + pDdiTable->pfnCreate = urSamplerCreate; + pDdiTable->pfnRetain = urSamplerRetain; + pDdiTable->pfnRelease = urSamplerRelease; + pDdiTable->pfnGetInfo = urSamplerGetInfo; + pDdiTable->pfnGetNativeHandle = urSamplerGetNativeHandle; + pDdiTable->pfnCreateWithNativeHandle = urSamplerCreateWithNativeHandle; return retVal; } @@ -254,11 +262,14 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetUSMProcAddrTable( if (UR_RESULT_SUCCESS != retVal) { return retVal; } - pDdiTable->pfnHostAlloc = nullptr; - pDdiTable->pfnDeviceAlloc = nullptr; - pDdiTable->pfnSharedAlloc = nullptr; - pDdiTable->pfnFree = nullptr; - pDdiTable->pfnGetMemAllocInfo = nullptr; + + pDdiTable->pfnHostAlloc = urUSMHostAlloc; + pDdiTable->pfnDeviceAlloc = urUSMDeviceAlloc; + pDdiTable->pfnSharedAlloc = urUSMSharedAlloc; + pDdiTable->pfnFree = urUSMFree; + pDdiTable->pfnGetMemAllocInfo = urUSMGetMemAllocInfo; + pDdiTable->pfnPoolCreate = urUSMPoolCreate; + pDdiTable->pfnPoolDestroy = urUSMPoolDestroy; return retVal; } @@ -277,10 +288,10 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetDeviceProcAddrTable( pDdiTable->pfnRetain = urDeviceRetain; pDdiTable->pfnRelease = urDeviceRelease; pDdiTable->pfnPartition = urDevicePartition; - pDdiTable->pfnSelectBinary = nullptr; - pDdiTable->pfnGetNativeHandle = nullptr; - pDdiTable->pfnCreateWithNativeHandle = nullptr; - pDdiTable->pfnGetGlobalTimestamps = nullptr; + pDdiTable->pfnSelectBinary = urDeviceSelectBinary; + pDdiTable->pfnGetNativeHandle = urDeviceGetNativeHandle; + pDdiTable->pfnCreateWithNativeHandle = urDeviceCreateWithNativeHandle; + pDdiTable->pfnGetGlobalTimestamps = urDeviceGetGlobalTimestamps; return retVal; } diff --git a/sycl/plugins/unified_runtime/ur_bindings.hpp b/sycl/plugins/unified_runtime/ur_bindings.hpp index 8597547221a88..a964b367c2b9e 100755 --- a/sycl/plugins/unified_runtime/ur_bindings.hpp +++ b/sycl/plugins/unified_runtime/ur_bindings.hpp @@ -31,10 +31,6 @@ struct ur_program_handle_t_ : public _ur_program_handle_t { using _ur_program_handle_t::_ur_program_handle_t; }; -struct ur_module_handle_t_ : public _ur_module_handle_t { - using _ur_module_handle_t::_ur_module_handle_t; -}; - struct ur_kernel_handle_t_ : public _ur_kernel_handle_t { using _ur_kernel_handle_t::_ur_kernel_handle_t; };