diff --git a/.codespellrc b/.codespellrc index 7f5cd147..a9febeb4 100644 --- a/.codespellrc +++ b/.codespellrc @@ -9,3 +9,7 @@ skip = ./.git,./build,./third_party,*.svg,./scripts/spec_metadata # codespell only flags words from its curated misspelling dictionary, but it is not # language-aware. Add identifiers/terms that collide with real words here (comma-separated). ignore-words-list = te,pevents +# ignore-words-list is case-insensitive; use ignore-regex for terms that are only +# valid in a specific case. NCE (Neural Compute Engine) is an acronym, but lowercase +# "nce" should still be caught as a typo for "once"/"nice". +ignore-regex = \bNCE\b diff --git a/CHANGELOG.md b/CHANGELOG.md index 062355a1..d8f44541 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,13 @@ # Level zero loader changelog +## v1.33.0 +* Update to L0 Zero Spec v1.18.31: https://oneapi-src.github.io/level-zero-spec/releases/index.html#level-zero-v1-18-31 +* Feature: Driver Extension Callback Tracing (#498) +* Add missing tracing definitions into template (#503) +* Fix: incorrect translation of null handle in zet API (#505) +* Fix: spelling and grammar issues in headers and docs (#501) +* Update zel* functions to use (void) instead of () (#497) +* Add stdbool.h for C header inclusion correctness (#494) +* Fix: incompatible strerror_r for non-gnu/windows libc (#493) ## v1.32.0 * Update to L0 Zero Spec v1.17.24: https://oneapi-src.github.io/level-zero-spec/releases/index.html#level-zero-v1-17-24 * Fix: add .mako deduplication to prevent multiple to_string definitions diff --git a/CMakeLists.txt b/CMakeLists.txt index 221f1dd4..2acb8734 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ if(MSVC AND (MSVC_VERSION LESS 1900)) endif() # This project follows semantic versioning (https://semver.org/) -project(level-zero VERSION 1.32.0) +project(level-zero VERSION 1.33.0) include(GNUInstallDirs) find_package(Git) diff --git a/PRODUCT_GUID.txt b/PRODUCT_GUID.txt index 1fa72bf5..9254fbfb 100644 --- a/PRODUCT_GUID.txt +++ b/PRODUCT_GUID.txt @@ -1,2 +1,2 @@ -1.32.0 -a4421a67-b1bb-4abe-8b70-9081ccb07991 \ No newline at end of file +1.33.0 +9aa8b76f-f86c-4b71-90b4-82b0dd7eb517 \ No newline at end of file diff --git a/include/layers/zel_tracing_register_cb.h b/include/layers/zel_tracing_register_cb.h index 4a4e9fde..845e8ead 100644 --- a/include/layers/zel_tracing_register_cb.h +++ b/include/layers/zel_tracing_register_cb.h @@ -915,6 +915,35 @@ typedef void (ZE_APICALL *ze_pfnDeviceGetCounterBasedEventMaxValueCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeDeviceGetCompilerInfo +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_device_get_compiler_info_params_t +{ + ze_device_handle_t* phDevice; + ze_device_compiler_info_t* pparamName; + const void** ppNext; + size_t** ppSize; + void** ppData; +} ze_device_get_compiler_info_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeDeviceGetCompilerInfo +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnDeviceGetCompilerInfoCb_t)( + ze_device_get_compiler_info_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeDeviceReserveCacheExt /// @details Each entry is a pointer to the parameter passed to the function; @@ -1155,6 +1184,32 @@ typedef void (ZE_APICALL *ze_pfnCommandQueueGetPriorityCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandQueueSetPriorityExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_command_queue_set_priority_ext_params_t +{ + ze_command_queue_handle_t* phCommandQueue; + ze_command_queue_priority_t* ppriority; +} ze_command_queue_set_priority_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandQueueSetPriorityExt +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnCommandQueueSetPriorityExtCb_t)( + ze_command_queue_set_priority_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeCommandQueueGetOrdinal /// @details Each entry is a pointer to the parameter passed to the function; @@ -1808,6 +1863,61 @@ typedef void (ZE_APICALL *ze_pfnCommandListAppendHostFunctionCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandListAppendSignalEventWithParameters +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_command_list_append_signal_event_with_parameters_params_t +{ + ze_command_list_handle_t* phCommandList; + const void ** ppNext; + ze_event_handle_t* phEvent; +} ze_command_list_append_signal_event_with_parameters_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandListAppendSignalEventWithParameters +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnCommandListAppendSignalEventWithParametersCb_t)( + ze_command_list_append_signal_event_with_parameters_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeCommandListAppendWaitOnEventsWithParameters +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_command_list_append_wait_on_events_with_parameters_params_t +{ + ze_command_list_handle_t* phCommandList; + const void ** ppNext; + uint32_t* pnumEvents; + ze_event_handle_t** pphEvents; +} ze_command_list_append_wait_on_events_with_parameters_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeCommandListAppendWaitOnEventsWithParameters +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnCommandListAppendWaitOnEventsWithParametersCb_t)( + ze_command_list_append_wait_on_events_with_parameters_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeCommandListAppendImageCopyToMemoryExt /// @details Each entry is a pointer to the parameter passed to the function; @@ -2784,6 +2894,32 @@ typedef void (ZE_APICALL *ze_pfnKernelGetAllocationPropertiesExpCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeKernelGetModuleHandle +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_kernel_get_module_handle_params_t +{ + ze_kernel_handle_t* phKernel; + ze_module_handle_t** pphModule; +} ze_kernel_get_module_handle_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeKernelGetModuleHandle +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnKernelGetModuleHandleCb_t)( + ze_kernel_get_module_handle_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeKernelSchedulingHintExp /// @details Each entry is a pointer to the parameter passed to the function; @@ -3033,6 +3169,32 @@ typedef void (ZE_APICALL *ze_pfnMemGetPitchFor2dImageCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeModuleGetDeviceHandle +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_module_get_device_handle_params_t +{ + ze_module_handle_t* phModule; + ze_device_handle_t** pphDevice; +} ze_module_get_device_handle_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeModuleGetDeviceHandle +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnModuleGetDeviceHandleCb_t)( + ze_module_get_device_handle_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zeModuleInspectLinkageExt /// @details Each entry is a pointer to the parameter passed to the function; @@ -3511,6 +3673,82 @@ typedef void (ZE_APICALL *ze_pfnGraphDestroyExtCb_t)( void** ppTracerInstanceUserData ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeGraphPauseCaptureExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_graph_pause_capture_ext_params_t +{ + ze_graph_handle_t* phGraph; +} ze_graph_pause_capture_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeGraphPauseCaptureExt +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnGraphPauseCaptureExtCb_t)( + ze_graph_pause_capture_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeGraphResumeCaptureExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_graph_resume_capture_ext_params_t +{ + ze_graph_handle_t* phGraph; +} ze_graph_resume_capture_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeGraphResumeCaptureExt +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnGraphResumeCaptureExtCb_t)( + ze_graph_resume_capture_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function parameters for zeGraphGetIdExt +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value + +typedef struct _ze_graph_get_id_ext_params_t +{ + ze_graph_handle_t* phGraph; + uint64_t** ppGraphId; +} ze_graph_get_id_ext_params_t; + + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Callback function-pointer for zeGraphGetIdExt +/// @param[in] params Parameters passed to this instance +/// @param[in] result Return value +/// @param[in] pTracerUserData Per-Tracer user data +/// @param[in,out] ppTracerInstanceUserData Per-Tracer, Per-Instance user data + +typedef void (ZE_APICALL *ze_pfnGraphGetIdExtCb_t)( + ze_graph_get_id_ext_params_t* params, + ze_result_t result, + void* pTracerUserData, + void** ppTracerInstanceUserData + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Callback function parameters for zerGetLastErrorDescription /// @details Each entry is a pointer to the parameter passed to the function; @@ -4353,6 +4591,14 @@ zelTracerCommandListAppendSignalEventRegisterCallback( ); +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListAppendSignalEventWithParametersRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListAppendSignalEventWithParametersCb_t pfnAppendSignalEventWithParametersCb + ); + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerCommandListAppendWaitOnEventsRegisterCallback( zel_tracer_handle_t hTracer, @@ -4361,6 +4607,14 @@ zelTracerCommandListAppendWaitOnEventsRegisterCallback( ); +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListAppendWaitOnEventsWithParametersRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListAppendWaitOnEventsWithParametersCb_t pfnAppendWaitOnEventsWithParametersCb + ); + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerEventHostSignalRegisterCallback( zel_tracer_handle_t hTracer, @@ -4713,6 +4967,14 @@ zelTracerModuleGetPropertiesRegisterCallback( ); +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerModuleGetDeviceHandleRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnModuleGetDeviceHandleCb_t pfnGetDeviceHandleCb + ); + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerKernelCreateRegisterCallback( zel_tracer_handle_t hTracer, @@ -4817,6 +5079,14 @@ zelTracerKernelGetNameRegisterCallback( ); +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerKernelGetModuleHandleRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnKernelGetModuleHandleCb_t pfnGetModuleHandleCb + ); + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerCommandListAppendLaunchKernelRegisterCallback( zel_tracer_handle_t hTracer, @@ -5609,6 +5879,30 @@ zelTracerGraphDestroyExtRegisterCallback( ); +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerGraphPauseCaptureExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphPauseCaptureExtCb_t pfnPauseCaptureExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerGraphResumeCaptureExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphResumeCaptureExtCb_t pfnResumeCaptureExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerGraphGetIdExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphGetIdExtCb_t pfnGetIdExtCb + ); + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerCommandListAppendHostFunctionRegisterCallback( zel_tracer_handle_t hTracer, @@ -5616,6 +5910,22 @@ zelTracerCommandListAppendHostFunctionRegisterCallback( ze_pfnCommandListAppendHostFunctionCb_t pfnAppendHostFunctionCb ); + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandQueueSetPriorityExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandQueueSetPriorityExtCb_t pfnSetPriorityExtCb + ); + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDeviceGetCompilerInfoRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDeviceGetCompilerInfoCb_t pfnGetCompilerInfoCb + ); + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerGetLastErrorDescriptionRegisterCallback( zel_tracer_handle_t hTracer, diff --git a/include/ze.py b/include/ze.py index 8add3ab1..a28fdffd 100644 --- a/include/ze.py +++ b/include/ze.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file ze.py - @version v1.17-r1.17.24 + @version v1.18-r1.18.31 """ import platform @@ -316,6 +316,7 @@ class ze_structure_type_v(IntEnum): IMAGE_FORMAT_SUPPORT_EXT_PROPERTIES = 0x10014 ## ::ze_image_format_support_ext_properties_t DEVICE_READONLY_MEMORY_EXT_PROPERTIES = 0x10015 ## ::ze_device_readonly_memory_ext_properties_t RELAXED_ALLOCATION_LIMITS_EXT_DESC = 0x10016 ## ::ze_relaxed_allocation_limits_ext_desc_t + POWER_SAVING_HINT_EXT_DESC = 0x10017 ## ::ze_context_power_saving_hint_ext_desc_t RELAXED_ALLOCATION_LIMITS_EXP_DESC = 0x00020001 ## ::ze_relaxed_allocation_limits_exp_desc_t MODULE_PROGRAM_EXP_DESC = 0x00020002 ## ::ze_module_program_exp_desc_t SCHEDULING_HINT_EXP_PROPERTIES = 0x00020003 ## ::ze_scheduling_hint_exp_properties_t @@ -382,6 +383,9 @@ class ze_structure_type_v(IntEnum): RUNTIME_REQUIREMENTS_OUTPUT = 0x00020046 ## ::ze_validate_runtime_requirements_output_t RECORD_REPLAY_GRAPH_EXT_PROPERTIES = 0x00020047 ## ::ze_record_replay_graph_ext_properties_t RECORD_REPLAY_GRAPH_EXT_DUMP_DESC = 0x00020048 ## ::ze_record_replay_graph_ext_dump_desc_t + DEVICE_NPU_PROPERTIES_EXT = 0x00020049 ## ::ze_device_npu_properties_ext_t + INIT_DRIVER_APP_VERSION_EXT_DESC = 0x0002004A ## ::ze_init_driver_app_version_ext_desc_t + IPC_PHYS_MEM_HANDLE_RANGE_EXT_DESC = 0x0002004B ## ::ze_ipc_phys_mem_handle_range_ext_desc_t class ze_structure_type_t(c_int): def __str__(self): @@ -567,7 +571,8 @@ class ze_api_version_v(IntEnum): _1_15 = ZE_MAKE_VERSION( 1, 15 ) ## version 1.15 _1_16 = ZE_MAKE_VERSION( 1, 16 ) ## version 1.16 _1_17 = ZE_MAKE_VERSION( 1, 17 ) ## version 1.17 - CURRENT = ZE_MAKE_VERSION( 1, 17 ) ## latest known version + _1_18 = ZE_MAKE_VERSION( 1, 18 ) ## version 1.18 + CURRENT = ZE_MAKE_VERSION( 1, 18 ) ## latest known version class ze_api_version_t(c_int): def __str__(self): @@ -576,7 +581,7 @@ def __str__(self): ############################################################################### ## @brief Current API version as a macro -ZE_API_VERSION_CURRENT_M = ZE_MAKE_VERSION( 1, 17 ) +ZE_API_VERSION_CURRENT_M = ZE_MAKE_VERSION( 1, 18 ) ############################################################################### ## @brief Maximum driver universal unique id (UUID) size in bytes @@ -1218,7 +1223,7 @@ class ze_command_queue_flags_v(IntEnum): ## this flag should be used when applications want full control over ## multi-engine submission and scheduling. ## This flag is **DEPRECATED** as flag - ## ${X}_COMMAND_LIST_FLAG_EXPLICIT_ONLY is **DEPRECATED**. + ## ::ZE_COMMAND_LIST_FLAG_EXPLICIT_ONLY is **DEPRECATED**. IN_ORDER = ZE_BIT(1) ## To be used only when creating immediate command lists. Commands ## appended to the immediate command ## list are executed in-order, with driver implementation enforcing @@ -1448,6 +1453,10 @@ class ze_event_counter_based_flags_v(IntEnum): GRAPH_EXTERNAL = ZE_BIT(6) ## Counter-based event is used for synchronization between recorded graph ## commands and commands submitted outside the graph (see ## ::zeGraphInstantiateExt in ::ZE_RECORD_REPLAY_GRAPH_EXT_NAME for details). + IPC_BIDIRECTIONAL = ZE_BIT(7) ## Extends ::ZE_EVENT_COUNTER_BASED_FLAG_IPC with bi-directional sharing. + ## Event opened in another process observes the latest state and can also + ## be used for signaling. + ## Must be combined with ::ZE_EVENT_COUNTER_BASED_FLAG_IPC class ze_event_counter_based_flags_t(c_int): def __str__(self): @@ -1547,7 +1556,16 @@ class ze_event_counter_based_external_aggregate_storage_desc_t(Structure): ("pNext", c_void_p), ## [in][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). ("deviceAddress", POINTER(c_ulonglong)), ## [in] device address that would be updated with atomic_add upon - ## signaling of this event, must be device USM memory + ## signaling of this event, must be device USM memory. + ## When this event is signaled from append operations that execute on + ## more than one device, the driver performs cross-device (peer) atomic + ## updates to this address. Not all devices support cross-device atomic + ## operations; the user must ensure atomics are supported between the + ## involved devices (see ::ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS returned + ## by ::zeDeviceGetP2PProperties, and cross-device capabilities returned + ## by ::zeDeviceGetMemoryAccessProperties). Using cross-device signaling + ## on devices that do not support cross-device atomics results in + ## undefined behavior. ("incrementValue", c_ulonglong), ## [in] value which would by atomically added upon each completion ("completionValue", c_ulonglong) ## [in] final completion value, when value under deviceAddress is equal ## or greater then this value then event is considered as completed. @@ -1936,6 +1954,8 @@ class ze_external_memory_import_fd_t(Structure): ## memory as a file descriptor. ## - The requested memory export type must have been specified when the ## allocation was made. +## - The returned `fd` is owned by the driver. The application must not +## close it directly. class ze_external_memory_export_fd_t(Structure): _fields_ = [ ("stype", ze_structure_type_t), ## [in] type of this structure @@ -1944,6 +1964,7 @@ class ze_external_memory_export_fd_t(Structure): ("flags", ze_external_memory_type_flags_t), ## [in] flags specifying the memory export type for the file descriptor. ## must be 0 (default) or a valid combination of ::ze_external_memory_type_flags_t ("fd", c_int) ## [out] the exported file descriptor handle representing the allocation. + ## Owned by the driver; must not be closed directly by the application. ] ############################################################################### @@ -2834,45 +2855,6 @@ def __str__(self): return str(ze_linkonce_odr_ext_version_v(self.value)) -############################################################################### -## @brief Power Saving Hint Extension Name -ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME = "ZE_experimental_power_saving_hint" - -############################################################################### -## @brief Power Saving Hint Extension Version(s) -class ze_power_saving_hint_exp_version_v(IntEnum): - _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 - CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version - -class ze_power_saving_hint_exp_version_t(c_int): - def __str__(self): - return str(ze_power_saving_hint_exp_version_v(self.value)) - - -############################################################################### -## @brief Supported device types -class ze_power_saving_hint_type_v(IntEnum): - MIN = 0 ## Minimum power savings. The device will make no attempt to save power - ## while executing work submitted to this context. - MAX = 100 ## Maximum power savings. The device will do everything to bring power to - ## a minimum while executing work submitted to this context. - -class ze_power_saving_hint_type_t(c_int): - def __str__(self): - return str(ze_power_saving_hint_type_v(self.value)) - - -############################################################################### -## @brief Extended context descriptor containing power saving hint. -class ze_context_power_saving_hint_exp_desc_t(Structure): - _fields_ = [ - ("stype", ze_structure_type_t), ## [in] type of this structure - ("pNext", c_void_p), ## [in][optional] must be null or a pointer to an extension-specific - ## structure (i.e. contains stype and pNext). - ("hint", c_ulong) ## [in] power saving hint (default value = 0). This is value from [0,100] - ## and can use pre-defined settings from ::ze_power_saving_hint_type_t. - ] - ############################################################################### ## @brief Subgroups Extension Name ZE_SUBGROUPS_EXT_NAME = "ZE_extension_subgroups" @@ -5697,6 +5679,342 @@ class ze_device_readonly_memory_ext_properties_t(Structure): ## hardware-enforced; writes cause a device fault. ] +############################################################################### +## @brief Command Queue Set Priority Extension Name +ZE_COMMAND_QUEUE_SET_PRIORITY_EXT_NAME = "ZE_extension_command_queue_set_priority" + +############################################################################### +## @brief Command Queue Set Priority Extension Version(s) +class ze_command_queue_set_priority_ext_version_v(IntEnum): + _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 + CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version + +class ze_command_queue_set_priority_ext_version_t(c_int): + def __str__(self): + return str(ze_command_queue_set_priority_ext_version_v(self.value)) + + +############################################################################### +## @brief Compiler-info list selected by ::zeDeviceGetCompilerInfo +class ze_device_compiler_info_v(IntEnum): + SPIRV_CAPABILITIES = 1 ## Supported SPIR-V capabilities, as an array of uint32_t numeric + ## capability identifiers + SPIRV_EXTENSIONS = 2 ## Supported SPIR-V extensions, as an array of null-terminated names, + ## each ::ZE_MAX_EXTENSION_NAME bytes + COMPILER_OPTIONS = 3 ## Supported compiler options, as a single null-terminated string of + ## space-separated tokens + DRIVER_OPTIONS = 4 ## Supported driver options, as a single null-terminated string of + ## space-separated tokens + +class ze_device_compiler_info_t(c_int): + def __str__(self): + return str(ze_device_compiler_info_v(self.value)) + + +############################################################################### +## @brief Name and version entry returned for the OpenCL C compiler-info lists +class ze_compiler_name_version_t(Structure): + _fields_ = [ + ("version", c_ulong), ## [out] packed version of the entry + ("name", c_char * ZE_MAX_EXTENSION_NAME) ## [out] null-terminated name + ] + +############################################################################### +## @brief Init Driver Application Version Extension Name +ZE_INIT_DRIVER_APP_VERSION_EXT_NAME = "ZE_extension_init_driver_app_version" + +############################################################################### +## @brief Init Driver Application Version Extension Version(s) +class ze_init_driver_app_version_ext_version_v(IntEnum): + _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 + CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version + +class ze_init_driver_app_version_ext_version_t(c_int): + def __str__(self): + return str(ze_init_driver_app_version_ext_version_v(self.value)) + + +############################################################################### +## @brief Declares the maximum core API version supported by the application +## +## @details +## - This structure may be passed to ::zeInitDrivers, via the `pNext` +## member of ::ze_init_driver_type_desc_t, to declare the maximum core +## API version the application was built against and is able to handle. +## - 'oneAPI' Level-Zero otherwise provides no mechanism for an application +## to communicate the API version it supports to a driver; +## ::zeDriverGetApiVersion only reports the version supported by the +## driver, not the application. A driver may use the application-declared +## version to gate version-dependent behavior for backward compatibility, +## for example only reporting enumerants or memory types introduced in +## newer API versions to applications that understand them. +## - If this structure is not provided, the driver must assume the +## application supports only the baseline behavior and must not rely on +## any version-gated behavior being understood by the application. +## - A driver should clamp version-gated behavior to the minimum of the +## version it supports and the version the application declares. +class ze_init_driver_app_version_ext_desc_t(Structure): + _fields_ = [ + ("stype", ze_structure_type_t), ## [in] type of this structure + ("pNext", c_void_p), ## [in][optional] must be null or a pointer to an extension-specific + ## structure (i.e. contains stype and pNext). + ("apiVersionHint", ze_api_version_t) ## [in] maximum core 'oneAPI' Level-Zero API version supported by the + ## application. + ] + +############################################################################### +## @brief IPC Physical Memory Range Extension Name +ZE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_NAME = "ZE_extension_ipc_phys_mem_handle_range" + +############################################################################### +## @brief IPC Physical Memory Range Extension Version(s) +class ze_ipc_phys_mem_handle_range_ext_version_v(IntEnum): + _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 + CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version + +class ze_ipc_phys_mem_handle_range_ext_version_t(c_int): + def __str__(self): + return str(ze_ipc_phys_mem_handle_range_ext_version_v(self.value)) + + +############################################################################### +## @brief Descriptor for capturing a VA range into an IPC memory handle. +## +## @details +## - Pass this structure via the `pNext` parameter of +## ::zeMemGetIpcHandleWithProperties. When present, the `ptr` argument +## specifies the base VA of the range rather than the base of a single +## allocation. +## - The `ptr` argument of ::zeMemGetIpcHandleWithProperties specifies the +## base VA of the range. +## - The range may span more than one reserved VA region created by +## ::zeVirtualMemReserve; the underlying reservations are not +## significant. What is captured is the ordered set of physical memory +## objects mapped along `[ptr, ptr+size)`. +## - The caller may start at an arbitrary offset within a mapped range and +## may capture a subset of a larger mapped range, provided the requested +## `[ptr, ptr+size)` is itself fully and contiguously mapped. +## - An individual physical memory object along the range need not be +## mapped at its own offset zero; ::zeVirtualMemMap may have mapped it at +## a non-zero offset into the physical object. The export captures the +## offset at which each physical object was mapped, and the importer +## reproduces each mapping at that same offset, so the importer views +## exactly the same memory as the exporter. +## - This extension is only supported for ranges backed by virtual +## reservations (::zeVirtualMemReserve) mapped to physical memory objects +## (::zeVirtualMemMap). Device, host, and shared USM pointers (from +## ::zeMemAllocDevice, ::zeMemAllocHost, and ::zeMemAllocShared) are not +## supported and will not be grouped into a range handle. If `[ptr, +## ptr+size)` includes any standard USM VA rather than a reserved VA, +## ::zeMemGetIpcHandleWithProperties returns +## ::ZE_RESULT_ERROR_INVALID_ARGUMENT. +## - The driver enumerates all physical memory objects mapped to `[ptr, +## ptr+size)` and encodes them into the returned IPC handle in VA order. +## - On the importer side, ::zeMemOpenIpcHandle decodes the handle and maps +## all physical objects into a fresh contiguous VA reservation in the +## same order. +## - The total addressable size on the importer equals `size`. When `ptr` +## begins at an offset within a physical memory object, the returned +## importer pointer corresponds to `ptr`, not to the base of the first +## encoded object. +## - The importer does not need to be told `size` out of band: the range +## handle is self-describing. Calling ::zeMemGetAddressRange on the +## pointer returned by ::zeMemOpenIpcHandle reports the base and full +## `size` of the imported range. +## - The exported IPC handle is a static snapshot taken at the time of the +## call. Physical memory subsequently mapped into, unmapped from, or +## grown beyond the exporter's VA range is not reflected in a previously +## exported handle or in any already-open importer view; a new export is +## required to share the additional mappings. +## - There is no application-visible limit on the number of physical memory +## objects a range may encode; how the driver represents and stores them +## is opaque and is not bound by the size of ::ze_ipc_mem_handle_t. If +## the driver cannot accommodate the range, for example it cannot store +## the number of physical objects being represented, +## ::zeMemGetIpcHandleWithProperties fails with +## ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE. +## - Returns ::ZE_RESULT_ERROR_ADDRESS_NOT_FOUND if any sub-region within +## `[ptr, ptr+size)` is not mapped to a physical memory object. The range +## must be fully mapped with no holes, because the importer is guaranteed +## a contiguous range and unmapped gaps cannot be represented. +## - Returns ::ZE_RESULT_ERROR_INVALID_SIZE if `size` is 0. +## - Returns ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE if the driver cannot +## accommodate the range, for example the number of physical memory +## objects encoded exceeds what the implementation can store. +## - Returns ::ZE_RESULT_ERROR_INVALID_NULL_POINTER if the `ptr` argument +## is NULL. +## - Returns ::ZE_RESULT_ERROR_INVALID_ARGUMENT if `[ptr, ptr+size)` +## includes a device, host, or shared USM allocation rather than reserved +## VA mapped to physical memory. +## - Returns ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE if the driver or device +## does not support the ::ZE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_NAME +## extension. +class ze_ipc_phys_mem_handle_range_ext_desc_t(Structure): + _fields_ = [ + ("stype", ze_structure_type_t), ## [in] type of this structure + ("pNext", c_void_p), ## [in][optional] must be null or a pointer to an extension-specific + ## structure (i.e. contains stype and pNext). + ("size", c_size_t) ## [in] size in bytes of the VA range starting at the `ptr` argument of + ## ::zeMemGetIpcHandleWithProperties; must be non-zero. The range + ## [ptr, ptr+size) must be fully mapped; see the details for error behavior. + ] + +############################################################################### +## @brief NPU Device Properties Extension Name +ZE_DEVICE_NPU_PROPERTIES_EXT_NAME = "ZE_extension_device_npu_properties" + +############################################################################### +## @brief NPU Device Properties Extension Version(s) +class ze_device_npu_properties_ext_version_v(IntEnum): + _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 + CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version + +class ze_device_npu_properties_ext_version_t(c_int): + def __str__(self): + return str(ze_device_npu_properties_ext_version_v(self.value)) + + +############################################################################### +## @brief NPU device properties queried using ::zeDeviceGetProperties +## +## @details +## - This structure may be returned from ::zeDeviceGetProperties via the +## `pNext` member of ::ze_device_properties_t. +## - Applicable only when the `type` member of ::ze_device_properties_t is +## ::ZE_DEVICE_TYPE_VPU. +## - Exposes NPU-native topology, clock, timestamp frequency, on-chip SRAM, +## and compiler capability information that has no clean analogue in the +## GPU-oriented base ::ze_device_properties_t struct. +## - `compilerVersion` and `maxOVOpsetVersionSupported` describe the +## compiler bundled with the driver, and report identical values for +## every device reported by a given driver instance. +## - The base ::ze_device_properties_t fields remain populated on NPU +## devices for backward compatibility with consumers that predate this +## extension. New consumers should prefer the NPU-native fields exposed +## here. +## - Identity (`vendorId`, `deviceId`, `subdeviceId`, `uuid`, `name`), +## capabilities (`flags`, `maxMemAllocSize`, `maxHardwareContexts`, +## `maxCommandQueuePriority`), and host/global timestamp validity +## (`timestampValidBits`) continue to be sourced from the base +## ::ze_device_properties_t struct. NPU does not implement kernel +## timestamp APIs; `kernelTimestampValidBits` is 0 on NPU devices. +class ze_device_npu_properties_ext_t(Structure): + _fields_ = [ + ("stype", ze_structure_type_t), ## [in] type of this structure + ("pNext", c_void_p), ## [in,out][optional] must be null or a pointer to an extension-specific + ## structure (i.e. contains stype and pNext). + ("tileCount", c_ulong), ## [out] Total number of NCE tiles enabled on the device. Equivalent to + ## popcount(tileEnableMask). Supersedes the `numSlices` member of + ## ::ze_device_properties_t for NPU devices. + ("tileEnableMask", c_ulong), ## [out] Bitmask of enabled NCE tiles. popcount(tileEnableMask) == + ## tileCount. + ("totalShaveCount", c_ulong), ## [out] Total number of SHAVE (VLIW) vector processors across all tiles. + ## Supersedes the `numEUsPerSubslice` member of ::ze_device_properties_t + ## for NPU devices. + ("int8x8MacsPerTile", c_ulong), ## [out] Multiply-accumulate (MAC) units per tile at INT8 x INT8 + ## precision (baseline). Throughput at other precisions: 2x for INT8 x + ## INT4, 0.5x for FP16 x FP16, 0.5x for INT16 x INT8, 1x for INT16 x + ## INT4. Supersedes half the `physicalEUSimdWidth` member of + ## ::ze_device_properties_t for NPU devices. + ("totalDpuMacs", c_ulong), ## [out] Total DPU MAC units across the device. Derived as tileCount * + ## int8x8MacsPerTile. + ("numComputeEngines", c_ulong), ## [out] Number of compute engines on the device. + ("numCopyEngines", c_ulong), ## [out] Number of copy (DMA) engines on the device. + ("dpuClockRateHz", c_ulonglong), ## [out] DPU compute clock rate, in Hz. Supersedes the `coreClockRate` + ## member of ::ze_device_properties_t for NPU devices. + ("timestampFreqHz", c_ulonglong), ## [out] Device timestamp counter frequency, in Hz. Used to convert raw + ## device tick counts returned by ::zeDeviceGetGlobalTimestamps and + ## ::zeCommandListAppendWriteGlobalTimestamp into time durations. + ("nnSramSizeBytes", c_ulonglong), ## [out] On-chip CMX SRAM size for neural network workloads, in bytes. + ("compilerVersion", c_ulong), ## [out] Version of the NPU compiler bundled with this driver, using + ## ::ZE_MAKE_VERSION. Use ::ZE_MAJOR_VERSION and ::ZE_MINOR_VERSION to + ## extract the major and minor components. + ("maxOVOpsetVersionSupported", c_ulong) ## [out] Maximum OpenVINO opset version supported by the bundled NPU + ## compiler. + ] + +############################################################################### +## @brief Power Saving Hint Extension Name +ZE_CONTEXT_POWER_SAVING_HINT_EXT_NAME = "ZE_extension_power_saving_hint" + +############################################################################### +## @brief Power Saving Hint Extension Version(s) +class ze_power_saving_hint_ext_version_v(IntEnum): + _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 + CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version + +class ze_power_saving_hint_ext_version_t(c_int): + def __str__(self): + return str(ze_power_saving_hint_ext_version_v(self.value)) + + +############################################################################### +## @brief Supported device types +class ze_power_saving_hint_ext_type_v(IntEnum): + MIN = 0 ## Minimum power savings. The device will make no attempt to save power + ## while executing work submitted to this context. + MAX = 100 ## Maximum power savings. The device will do everything to bring power to + ## a minimum while executing work submitted to this context. + +class ze_power_saving_hint_ext_type_t(c_int): + def __str__(self): + return str(ze_power_saving_hint_ext_type_v(self.value)) + + +############################################################################### +## @brief Extended context descriptor containing power saving hint. +class ze_context_power_saving_hint_ext_desc_t(Structure): + _fields_ = [ + ("stype", ze_structure_type_t), ## [in] type of this structure + ("pNext", c_void_p), ## [in][optional] must be null or a pointer to an extension-specific + ## structure (i.e. contains stype and pNext). + ("hint", c_ulong) ## [in] power saving hint (default value = 0). This is value from [0,100] + ## and can use pre-defined settings from ::ze_power_saving_hint_ext_type_t. + ] + +############################################################################### +## @brief Power Saving Hint Extension Name. @deprecated since 1.18: Use +## ::ZE_CONTEXT_POWER_SAVING_HINT_EXT_NAME instead. +ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME = "ZE_experimental_power_saving_hint" + +############################################################################### +## @brief Power Saving Hint Extension Version(s). @deprecated since 1.18: Use +## ::ze_context_power_saving_hint_ext_desc_t instead. +class ze_power_saving_hint_exp_version_v(IntEnum): + _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 + CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version + +class ze_power_saving_hint_exp_version_t(c_int): + def __str__(self): + return str(ze_power_saving_hint_exp_version_v(self.value)) + + +############################################################################### +## @brief Supported device types. @deprecated since 1.18: Use +## ::ze_power_saving_hint_ext_type_t instead. +class ze_power_saving_hint_type_v(IntEnum): + MIN = 0 ## Minimum power savings. The device will make no attempt to save power + ## while executing work submitted to this context. + MAX = 100 ## Maximum power savings. The device will do everything to bring power to + ## a minimum while executing work submitted to this context. + +class ze_power_saving_hint_type_t(c_int): + def __str__(self): + return str(ze_power_saving_hint_type_v(self.value)) + + +############################################################################### +## @brief Extended context descriptor containing power saving hint. @deprecated +## since 1.18: Use ::ze_context_power_saving_hint_ext_desc_t instead. +class ze_context_power_saving_hint_exp_desc_t(Structure): + _fields_ = [ + ("stype", ze_structure_type_t), ## [in] type of this structure + ("pNext", c_void_p), ## [in][optional] must be null or a pointer to an extension-specific + ## structure (i.e. contains stype and pNext). + ("hint", c_ulong) ## [in] power saving hint (default value = 0). This is value from [0,100] + ## and can use pre-defined settings from ::ze_power_saving_hint_type_t. + ] + ############################################################################### __use_win_types = "Windows" == platform.uname()[0] @@ -6177,6 +6495,13 @@ class _ze_driver_exp_dditable_t(Structure): else: _zeDeviceGetCounterBasedEventMaxValue_t = CFUNCTYPE( ze_result_t, ze_device_handle_t, POINTER(c_ulonglong) ) +############################################################################### +## @brief Function-pointer for zeDeviceGetCompilerInfo +if __use_win_types: + _zeDeviceGetCompilerInfo_t = WINFUNCTYPE( ze_result_t, ze_device_handle_t, ze_device_compiler_info_t, c_void_p, POINTER(c_size_t), c_void_p ) +else: + _zeDeviceGetCompilerInfo_t = CFUNCTYPE( ze_result_t, ze_device_handle_t, ze_device_compiler_info_t, c_void_p, POINTER(c_size_t), c_void_p ) + ############################################################################### ## @brief Table of Device functions pointers @@ -6209,7 +6534,8 @@ class _ze_device_dditable_t(Structure): ("pfnGetRuntimeRequirements", c_void_p), ## _zeDeviceGetRuntimeRequirements_t ("pfnGetRuntimeRequirementsKey", c_void_p), ## _zeDeviceGetRuntimeRequirementsKey_t ("pfnValidateRuntimeRequirements", c_void_p), ## _zeDeviceValidateRuntimeRequirements_t - ("pfnGetCounterBasedEventMaxValue", c_void_p) ## _zeDeviceGetCounterBasedEventMaxValue_t + ("pfnGetCounterBasedEventMaxValue", c_void_p), ## _zeDeviceGetCounterBasedEventMaxValue_t + ("pfnGetCompilerInfo", c_void_p) ## _zeDeviceGetCompilerInfo_t ] ############################################################################### @@ -6369,6 +6695,13 @@ class _ze_context_dditable_t(Structure): else: _zeCommandQueueGetPriority_t = CFUNCTYPE( ze_result_t, ze_command_queue_handle_t, POINTER(ze_command_queue_priority_t) ) +############################################################################### +## @brief Function-pointer for zeCommandQueueSetPriorityExt +if __use_win_types: + _zeCommandQueueSetPriorityExt_t = WINFUNCTYPE( ze_result_t, ze_command_queue_handle_t, ze_command_queue_priority_t ) +else: + _zeCommandQueueSetPriorityExt_t = CFUNCTYPE( ze_result_t, ze_command_queue_handle_t, ze_command_queue_priority_t ) + ############################################################################### ## @brief Table of CommandQueue functions pointers @@ -6382,7 +6715,8 @@ class _ze_command_queue_dditable_t(Structure): ("pfnGetIndex", c_void_p), ## _zeCommandQueueGetIndex_t ("pfnGetFlags", c_void_p), ## _zeCommandQueueGetFlags_t ("pfnGetMode", c_void_p), ## _zeCommandQueueGetMode_t - ("pfnGetPriority", c_void_p) ## _zeCommandQueueGetPriority_t + ("pfnGetPriority", c_void_p), ## _zeCommandQueueGetPriority_t + ("pfnSetPriorityExt", c_void_p) ## _zeCommandQueueSetPriorityExt_t ] ############################################################################### @@ -6749,6 +7083,20 @@ class _ze_command_queue_dditable_t(Structure): else: _zeCommandListAppendHostFunction_t = CFUNCTYPE( ze_result_t, ze_command_list_handle_t, ze_host_function_callback_t, c_void_p, c_void_p, ze_event_handle_t, c_ulong, POINTER(ze_event_handle_t) ) +############################################################################### +## @brief Function-pointer for zeCommandListAppendSignalEventWithParameters +if __use_win_types: + _zeCommandListAppendSignalEventWithParameters_t = WINFUNCTYPE( ze_result_t, ze_command_list_handle_t, *, ze_event_handle_t ) +else: + _zeCommandListAppendSignalEventWithParameters_t = CFUNCTYPE( ze_result_t, ze_command_list_handle_t, *, ze_event_handle_t ) + +############################################################################### +## @brief Function-pointer for zeCommandListAppendWaitOnEventsWithParameters +if __use_win_types: + _zeCommandListAppendWaitOnEventsWithParameters_t = WINFUNCTYPE( ze_result_t, ze_command_list_handle_t, *, c_ulong, POINTER(ze_event_handle_t) ) +else: + _zeCommandListAppendWaitOnEventsWithParameters_t = CFUNCTYPE( ze_result_t, ze_command_list_handle_t, *, c_ulong, POINTER(ze_event_handle_t) ) + ############################################################################### ## @brief Table of CommandList functions pointers @@ -6805,7 +7153,9 @@ class _ze_command_list_dditable_t(Structure): ("pfnEndGraphCaptureExt", c_void_p), ## _zeCommandListEndGraphCaptureExt_t ("pfnGetGraphExt", c_void_p), ## _zeCommandListGetGraphExt_t ("pfnAppendGraphExt", c_void_p), ## _zeCommandListAppendGraphExt_t - ("pfnAppendHostFunction", c_void_p) ## _zeCommandListAppendHostFunction_t + ("pfnAppendHostFunction", c_void_p), ## _zeCommandListAppendHostFunction_t + ("pfnAppendSignalEventWithParameters", c_void_p), ## _zeCommandListAppendSignalEventWithParameters_t + ("pfnAppendWaitOnEventsWithParameters", c_void_p) ## _zeCommandListAppendWaitOnEventsWithParameters_t ] ############################################################################### @@ -7454,6 +7804,13 @@ class _ze_event_exp_dditable_t(Structure): else: _zeModuleInspectLinkageExt_t = CFUNCTYPE( ze_result_t, POINTER(ze_linkage_inspection_ext_desc_t), c_ulong, POINTER(ze_module_handle_t), POINTER(ze_module_build_log_handle_t) ) +############################################################################### +## @brief Function-pointer for zeModuleGetDeviceHandle +if __use_win_types: + _zeModuleGetDeviceHandle_t = WINFUNCTYPE( ze_result_t, ze_module_handle_t, POINTER(ze_device_handle_t) ) +else: + _zeModuleGetDeviceHandle_t = CFUNCTYPE( ze_result_t, ze_module_handle_t, POINTER(ze_device_handle_t) ) + ############################################################################### ## @brief Table of Module functions pointers @@ -7467,7 +7824,8 @@ class _ze_module_dditable_t(Structure): ("pfnGetKernelNames", c_void_p), ## _zeModuleGetKernelNames_t ("pfnGetProperties", c_void_p), ## _zeModuleGetProperties_t ("pfnGetFunctionPointer", c_void_p), ## _zeModuleGetFunctionPointer_t - ("pfnInspectLinkageExt", c_void_p) ## _zeModuleInspectLinkageExt_t + ("pfnInspectLinkageExt", c_void_p), ## _zeModuleInspectLinkageExt_t + ("pfnGetDeviceHandle", c_void_p) ## _zeModuleGetDeviceHandle_t ] ############################################################################### @@ -7577,6 +7935,13 @@ class _ze_module_build_log_dditable_t(Structure): else: _zeKernelGetName_t = CFUNCTYPE( ze_result_t, ze_kernel_handle_t, POINTER(c_size_t), c_char_p ) +############################################################################### +## @brief Function-pointer for zeKernelGetModuleHandle +if __use_win_types: + _zeKernelGetModuleHandle_t = WINFUNCTYPE( ze_result_t, ze_kernel_handle_t, POINTER(ze_module_handle_t) ) +else: + _zeKernelGetModuleHandle_t = CFUNCTYPE( ze_result_t, ze_kernel_handle_t, POINTER(ze_module_handle_t) ) + ############################################################################### ## @brief Table of Kernel functions pointers @@ -7593,7 +7958,8 @@ class _ze_kernel_dditable_t(Structure): ("pfnGetIndirectAccess", c_void_p), ## _zeKernelGetIndirectAccess_t ("pfnGetSourceAttributes", c_void_p), ## _zeKernelGetSourceAttributes_t ("pfnGetProperties", c_void_p), ## _zeKernelGetProperties_t - ("pfnGetName", c_void_p) ## _zeKernelGetName_t + ("pfnGetName", c_void_p), ## _zeKernelGetName_t + ("pfnGetModuleHandle", c_void_p) ## _zeKernelGetModuleHandle_t ] ############################################################################### @@ -7871,6 +8237,27 @@ class _ze_fabric_edge_exp_dditable_t(Structure): else: _zeGraphDestroyExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t ) +############################################################################### +## @brief Function-pointer for zeGraphPauseCaptureExt +if __use_win_types: + _zeGraphPauseCaptureExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t ) +else: + _zeGraphPauseCaptureExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t ) + +############################################################################### +## @brief Function-pointer for zeGraphResumeCaptureExt +if __use_win_types: + _zeGraphResumeCaptureExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t ) +else: + _zeGraphResumeCaptureExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t ) + +############################################################################### +## @brief Function-pointer for zeGraphGetIdExt +if __use_win_types: + _zeGraphGetIdExt_t = WINFUNCTYPE( ze_result_t, ze_graph_handle_t, POINTER(c_ulonglong) ) +else: + _zeGraphGetIdExt_t = CFUNCTYPE( ze_result_t, ze_graph_handle_t, POINTER(c_ulonglong) ) + ############################################################################### ## @brief Table of Graph functions pointers @@ -7882,7 +8269,10 @@ class _ze_graph_dditable_t(Structure): ("pfnInstantiateExt", c_void_p), ## _zeGraphInstantiateExt_t ("pfnIsEmptyExt", c_void_p), ## _zeGraphIsEmptyExt_t ("pfnDumpContentsExt", c_void_p), ## _zeGraphDumpContentsExt_t - ("pfnDestroyExt", c_void_p) ## _zeGraphDestroyExt_t + ("pfnDestroyExt", c_void_p), ## _zeGraphDestroyExt_t + ("pfnPauseCaptureExt", c_void_p), ## _zeGraphPauseCaptureExt_t + ("pfnResumeCaptureExt", c_void_p), ## _zeGraphResumeCaptureExt_t + ("pfnGetIdExt", c_void_p) ## _zeGraphGetIdExt_t ] ############################################################################### @@ -8086,6 +8476,7 @@ def __init__(self, version : ze_api_version_t): self.zeDeviceGetRuntimeRequirementsKey = _zeDeviceGetRuntimeRequirementsKey_t(self.__dditable.Device.pfnGetRuntimeRequirementsKey) self.zeDeviceValidateRuntimeRequirements = _zeDeviceValidateRuntimeRequirements_t(self.__dditable.Device.pfnValidateRuntimeRequirements) self.zeDeviceGetCounterBasedEventMaxValue = _zeDeviceGetCounterBasedEventMaxValue_t(self.__dditable.Device.pfnGetCounterBasedEventMaxValue) + self.zeDeviceGetCompilerInfo = _zeDeviceGetCompilerInfo_t(self.__dditable.Device.pfnGetCompilerInfo) # call driver to get function pointers _DeviceExp = _ze_device_exp_dditable_t() @@ -8132,6 +8523,7 @@ def __init__(self, version : ze_api_version_t): self.zeCommandQueueGetFlags = _zeCommandQueueGetFlags_t(self.__dditable.CommandQueue.pfnGetFlags) self.zeCommandQueueGetMode = _zeCommandQueueGetMode_t(self.__dditable.CommandQueue.pfnGetMode) self.zeCommandQueueGetPriority = _zeCommandQueueGetPriority_t(self.__dditable.CommandQueue.pfnGetPriority) + self.zeCommandQueueSetPriorityExt = _zeCommandQueueSetPriorityExt_t(self.__dditable.CommandQueue.pfnSetPriorityExt) # call driver to get function pointers _CommandList = _ze_command_list_dditable_t() @@ -8193,6 +8585,8 @@ def __init__(self, version : ze_api_version_t): self.zeCommandListGetGraphExt = _zeCommandListGetGraphExt_t(self.__dditable.CommandList.pfnGetGraphExt) self.zeCommandListAppendGraphExt = _zeCommandListAppendGraphExt_t(self.__dditable.CommandList.pfnAppendGraphExt) self.zeCommandListAppendHostFunction = _zeCommandListAppendHostFunction_t(self.__dditable.CommandList.pfnAppendHostFunction) + self.zeCommandListAppendSignalEventWithParameters = _zeCommandListAppendSignalEventWithParameters_t(self.__dditable.CommandList.pfnAppendSignalEventWithParameters) + self.zeCommandListAppendWaitOnEventsWithParameters = _zeCommandListAppendWaitOnEventsWithParameters_t(self.__dditable.CommandList.pfnAppendWaitOnEventsWithParameters) # call driver to get function pointers _CommandListExp = _ze_command_list_exp_dditable_t() @@ -8357,6 +8751,7 @@ def __init__(self, version : ze_api_version_t): self.zeModuleGetProperties = _zeModuleGetProperties_t(self.__dditable.Module.pfnGetProperties) self.zeModuleGetFunctionPointer = _zeModuleGetFunctionPointer_t(self.__dditable.Module.pfnGetFunctionPointer) self.zeModuleInspectLinkageExt = _zeModuleInspectLinkageExt_t(self.__dditable.Module.pfnInspectLinkageExt) + self.zeModuleGetDeviceHandle = _zeModuleGetDeviceHandle_t(self.__dditable.Module.pfnGetDeviceHandle) # call driver to get function pointers _ModuleBuildLog = _ze_module_build_log_dditable_t() @@ -8389,6 +8784,7 @@ def __init__(self, version : ze_api_version_t): self.zeKernelGetSourceAttributes = _zeKernelGetSourceAttributes_t(self.__dditable.Kernel.pfnGetSourceAttributes) self.zeKernelGetProperties = _zeKernelGetProperties_t(self.__dditable.Kernel.pfnGetProperties) self.zeKernelGetName = _zeKernelGetName_t(self.__dditable.Kernel.pfnGetName) + self.zeKernelGetModuleHandle = _zeKernelGetModuleHandle_t(self.__dditable.Kernel.pfnGetModuleHandle) # call driver to get function pointers _KernelExp = _ze_kernel_exp_dditable_t() @@ -8482,6 +8878,9 @@ def __init__(self, version : ze_api_version_t): self.zeGraphIsEmptyExt = _zeGraphIsEmptyExt_t(self.__dditable.Graph.pfnIsEmptyExt) self.zeGraphDumpContentsExt = _zeGraphDumpContentsExt_t(self.__dditable.Graph.pfnDumpContentsExt) self.zeGraphDestroyExt = _zeGraphDestroyExt_t(self.__dditable.Graph.pfnDestroyExt) + self.zeGraphPauseCaptureExt = _zeGraphPauseCaptureExt_t(self.__dditable.Graph.pfnPauseCaptureExt) + self.zeGraphResumeCaptureExt = _zeGraphResumeCaptureExt_t(self.__dditable.Graph.pfnResumeCaptureExt) + self.zeGraphGetIdExt = _zeGraphGetIdExt_t(self.__dditable.Graph.pfnGetIdExt) # call driver to get function pointers _ExecutableGraph = _ze_executable_graph_dditable_t() diff --git a/include/ze_api.h b/include/ze_api.h index f4522677..7fbf4395 100644 --- a/include/ze_api.h +++ b/include/ze_api.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT * * @file ze_api.h - * @version v1.17-r1.17.24 + * @version v1.18-r1.18.31 * */ #ifndef _ZE_API_H @@ -350,6 +350,7 @@ typedef enum _ze_structure_type_t ZE_STRUCTURE_TYPE_IMAGE_FORMAT_SUPPORT_EXT_PROPERTIES = 0x10014, ///< ::ze_image_format_support_ext_properties_t ZE_STRUCTURE_TYPE_DEVICE_READONLY_MEMORY_EXT_PROPERTIES = 0x10015, ///< ::ze_device_readonly_memory_ext_properties_t ZE_STRUCTURE_TYPE_RELAXED_ALLOCATION_LIMITS_EXT_DESC = 0x10016, ///< ::ze_relaxed_allocation_limits_ext_desc_t + ZE_STRUCTURE_TYPE_POWER_SAVING_HINT_EXT_DESC = 0x10017, ///< ::ze_context_power_saving_hint_ext_desc_t ZE_STRUCTURE_TYPE_RELAXED_ALLOCATION_LIMITS_EXP_DESC = 0x00020001, ///< ::ze_relaxed_allocation_limits_exp_desc_t ZE_STRUCTURE_TYPE_MODULE_PROGRAM_EXP_DESC = 0x00020002, ///< ::ze_module_program_exp_desc_t ZE_STRUCTURE_TYPE_SCHEDULING_HINT_EXP_PROPERTIES = 0x00020003, ///< ::ze_scheduling_hint_exp_properties_t @@ -416,6 +417,9 @@ typedef enum _ze_structure_type_t ZE_STRUCTURE_TYPE_RUNTIME_REQUIREMENTS_OUTPUT = 0x00020046, ///< ::ze_validate_runtime_requirements_output_t ZE_STRUCTURE_TYPE_RECORD_REPLAY_GRAPH_EXT_PROPERTIES = 0x00020047, ///< ::ze_record_replay_graph_ext_properties_t ZE_STRUCTURE_TYPE_RECORD_REPLAY_GRAPH_EXT_DUMP_DESC = 0x00020048, ///< ::ze_record_replay_graph_ext_dump_desc_t + ZE_STRUCTURE_TYPE_DEVICE_NPU_PROPERTIES_EXT = 0x00020049, ///< ::ze_device_npu_properties_ext_t + ZE_STRUCTURE_TYPE_INIT_DRIVER_APP_VERSION_EXT_DESC = 0x0002004A, ///< ::ze_init_driver_app_version_ext_desc_t + ZE_STRUCTURE_TYPE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_DESC = 0x0002004B, ///< ::ze_ipc_phys_mem_handle_range_ext_desc_t ZE_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_STRUCTURE_TYPE_* ENUMs } ze_structure_type_t; @@ -851,10 +855,6 @@ typedef struct _ze_scheduling_hint_exp_properties_t ze_scheduling_hint_exp_prope /// @brief Forward-declare ze_scheduling_hint_exp_desc_t typedef struct _ze_scheduling_hint_exp_desc_t ze_scheduling_hint_exp_desc_t; -/////////////////////////////////////////////////////////////////////////////// -/// @brief Forward-declare ze_context_power_saving_hint_exp_desc_t -typedef struct _ze_context_power_saving_hint_exp_desc_t ze_context_power_saving_hint_exp_desc_t; - /////////////////////////////////////////////////////////////////////////////// /// @brief Forward-declare ze_eu_count_ext_t typedef struct _ze_eu_count_ext_t ze_eu_count_ext_t; @@ -1227,6 +1227,30 @@ typedef struct _ze_record_replay_graph_ext_dump_desc_t ze_record_replay_graph_ex /// @brief Forward-declare ze_device_readonly_memory_ext_properties_t typedef struct _ze_device_readonly_memory_ext_properties_t ze_device_readonly_memory_ext_properties_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_compiler_name_version_t +typedef struct _ze_compiler_name_version_t ze_compiler_name_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_init_driver_app_version_ext_desc_t +typedef struct _ze_init_driver_app_version_ext_desc_t ze_init_driver_app_version_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_ipc_phys_mem_handle_range_ext_desc_t +typedef struct _ze_ipc_phys_mem_handle_range_ext_desc_t ze_ipc_phys_mem_handle_range_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_device_npu_properties_ext_t +typedef struct _ze_device_npu_properties_ext_t ze_device_npu_properties_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_context_power_saving_hint_ext_desc_t +typedef struct _ze_context_power_saving_hint_ext_desc_t ze_context_power_saving_hint_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare ze_context_power_saving_hint_exp_desc_t +typedef struct _ze_context_power_saving_hint_exp_desc_t ze_context_power_saving_hint_exp_desc_t; + #if !defined(__GNUC__) #pragma endregion @@ -1469,7 +1493,8 @@ typedef enum _ze_api_version_t ZE_API_VERSION_1_15 = ZE_MAKE_VERSION( 1, 15 ), ///< version 1.15 ZE_API_VERSION_1_16 = ZE_MAKE_VERSION( 1, 16 ), ///< version 1.16 ZE_API_VERSION_1_17 = ZE_MAKE_VERSION( 1, 17 ), ///< version 1.17 - ZE_API_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 17 ), ///< latest known version + ZE_API_VERSION_1_18 = ZE_MAKE_VERSION( 1, 18 ), ///< version 1.18 + ZE_API_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 18 ), ///< latest known version ZE_API_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_API_VERSION_* ENUMs } ze_api_version_t; @@ -1477,7 +1502,7 @@ typedef enum _ze_api_version_t /////////////////////////////////////////////////////////////////////////////// #ifndef ZE_API_VERSION_CURRENT_M /// @brief Current API version as a macro -#define ZE_API_VERSION_CURRENT_M ZE_MAKE_VERSION( 1, 17 ) +#define ZE_API_VERSION_CURRENT_M ZE_MAKE_VERSION( 1, 18 ) #endif // ZE_API_VERSION_CURRENT_M /////////////////////////////////////////////////////////////////////////////// @@ -3446,7 +3471,7 @@ typedef enum _ze_command_queue_flag_t ///< this flag should be used when applications want full control over ///< multi-engine submission and scheduling. ///< This flag is **DEPRECATED** as flag - ///< ${X}_COMMAND_LIST_FLAG_EXPLICIT_ONLY is **DEPRECATED**. + ///< ::ZE_COMMAND_LIST_FLAG_EXPLICIT_ONLY is **DEPRECATED**. ZE_COMMAND_QUEUE_FLAG_IN_ORDER = ZE_BIT(1), ///< To be used only when creating immediate command lists. Commands ///< appended to the immediate command ///< list are executed in-order, with driver implementation enforcing @@ -5553,6 +5578,10 @@ typedef enum _ze_event_counter_based_flag_t ZE_EVENT_COUNTER_BASED_FLAG_GRAPH_EXTERNAL = ZE_BIT(6), ///< Counter-based event is used for synchronization between recorded graph ///< commands and commands submitted outside the graph (see ///< ::zeGraphInstantiateExt in ::ZE_RECORD_REPLAY_GRAPH_EXT_NAME for details). + ZE_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL = ZE_BIT(7), ///< Extends ::ZE_EVENT_COUNTER_BASED_FLAG_IPC with bi-directional sharing. + ///< Event opened in another process observes the latest state and can also + ///< be used for signaling. + ///< Must be combined with ::ZE_EVENT_COUNTER_BASED_FLAG_IPC ZE_EVENT_COUNTER_BASED_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_EVENT_COUNTER_BASED_FLAG_* ENUMs } ze_event_counter_based_flag_t; @@ -5654,7 +5683,16 @@ typedef struct _ze_event_counter_based_external_aggregate_storage_desc_t const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). uint64_t* deviceAddress; ///< [in] device address that would be updated with atomic_add upon - ///< signaling of this event, must be device USM memory + ///< signaling of this event, must be device USM memory. + ///< When this event is signaled from append operations that execute on + ///< more than one device, the driver performs cross-device (peer) atomic + ///< updates to this address. Not all devices support cross-device atomic + ///< operations; the user must ensure atomics are supported between the + ///< involved devices (see ::ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS returned + ///< by ::zeDeviceGetP2PProperties, and cross-device capabilities returned + ///< by ::zeDeviceGetMemoryAccessProperties). Using cross-device signaling + ///< on devices that do not support cross-device atomics results in + ///< undefined behavior. uint64_t incrementValue; ///< [in] value which would by atomically added upon each completion uint64_t completionValue; ///< [in] final completion value, when value under deviceAddress is equal ///< or greater then this value then event is considered as completed. @@ -5721,7 +5759,6 @@ zeEventCreate( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE /// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE /// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS /// - ::ZE_RESULT_ERROR_NOT_AVAILABLE @@ -5735,12 +5772,15 @@ zeEventCreate( /// + `nullptr == desc` /// + `nullptr == phEvent` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x7f < desc->flags` +/// + `0xff < desc->flags` /// + `0x7 < desc->signal` /// + `0x7 < desc->wait` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT /// + `completionValue` provided in `pNext` ::ze_event_counter_based_external_sync_allocation_desc_t or ::ze_event_counter_based_external_aggregate_storage_desc_t exceeds the value returned by ::zeDeviceGetCounterBasedEventMaxValue +/// + ::ZE_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL is set without ::ZE_EVENT_COUNTER_BASED_FLAG_IPC +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + ::ZE_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL is set and the implementation does not provide bi-directional IPC sharing ZE_APIEXPORT ze_result_t ZE_APICALL zeEventCounterBasedCreate( ze_context_handle_t hContext, ///< [in] handle of the context object @@ -5943,6 +5983,17 @@ zeEventPoolCloseIpcHandle( /// @brief Gets an IPC counter based event handle that can be shared with another /// process. /// +/// @details +/// - When the event was created with +/// ::ZE_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL, it may be shared +/// before it is enqueued for signaling for the first time, and the +/// returned handle remains valid after the event state is replaced by a +/// signal operation. It does not have to be obtained again. +/// - Without that flag, a handle represents the state captured at the time +/// of this call. A new handle must be obtained every time the state is +/// replaced, and this function returns ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// for an event that has not been enqueued for signaling yet. +/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -5972,6 +6023,22 @@ zeEventCounterBasedGetIpcHandle( /// @brief Opens an IPC event handle to retrieve from another process. /// /// @details +/// - IPC sharing is bi-directional when the exported event was created with +/// ::ZE_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL. The opened event then +/// refers to the same synchronization point as the event in the exporting +/// process and may be used for waiting, querying and signaling. Without +/// that flag the opened event holds the state captured when its handle +/// was obtained, may be used only for waiting and querying, and must be +/// opened again every time the state is replaced in the exporting +/// process. +/// - With bi-directional sharing, the opened event remains valid after its +/// state is replaced by a signal operation performed in either process. +/// It does not have to be opened again, and both processes observe the +/// latest state. +/// - With bi-directional sharing, the application must keep both processes +/// alive for as long as the opened event is used. Waiting on, querying or +/// signaling the event after the process that produced the latest state +/// has exited results in undefined behavior. /// - The `hContext` parameter has no requirement to match the context that /// was used to create the event in the exporting process. Any context of /// the importing process may be used, including the driver's default @@ -5981,8 +6048,9 @@ zeEventCounterBasedGetIpcHandle( /// signaling, no device is yet associated with it; if the event has been /// enqueued for signaling, it is associated with the device performing /// that signal operation. -/// - Any device of the importing process may signal the opened event. -/// Enqueuing a signal operation overwrites the previous tracking point. +/// - With bi-directional sharing, any device of the importing process may +/// signal the opened event. Enqueuing a signal operation overwrites the +/// previous tracking point. /// - A device may wait on the opened event only if it has P2P access to the /// device associated with the current tracking point. The set of devices /// that may wait therefore depends on the P2P capabilities relative to @@ -5994,7 +6062,6 @@ zeEventCounterBasedGetIpcHandle( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE /// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE /// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS /// - ::ZE_RESULT_ERROR_NOT_AVAILABLE @@ -6006,6 +6073,8 @@ zeEventCounterBasedGetIpcHandle( /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == phEvent` /// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + the handle was exported by an event created with ::ZE_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL and the implementation does not provide bi-directional IPC sharing ZE_APIEXPORT ze_result_t ZE_APICALL zeEventCounterBasedOpenIpcHandle( ze_context_handle_t hContext, ///< [in] handle of the context object to associate with the IPC event @@ -6093,6 +6162,8 @@ zeEventCounterBasedGetDeviceAddress( /// - The application must **not** call this function from simultaneous /// threads with the same command list handle. /// - The implementation of this function should be lock-free. +/// - Passing additional parameters is possible with +/// ::zeCommandListAppendSignalEventWithParameters function. /// /// @remarks /// _Analogues_ @@ -6123,6 +6194,62 @@ zeCommandListAppendSignalEvent( ze_event_handle_t hEvent ///< [in] handle of the event ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Appends a signal of the event from the device into a command list and +/// allows to pass additional parameters. +/// +/// @details +/// - The application must ensure the events are accessible by the device on +/// which the command list was created. This requirement does not apply to +/// counter-based events. +/// - For counter-based events, the event may be signaled on any device, +/// regardless of the device used to create the event. When a +/// counter-based event is passed for signaling, it drops its previous +/// tracking point and re-associates with the device on which the command +/// list was created, tracking the new signaling point. No peer-to-peer +/// access between the previously associated device and the new signaling +/// device is required. +/// - The duration of an event created from an event pool that was created +/// using ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP or +/// ::ZE_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP flags is undefined. +/// However, for consistency and orthogonality the event will report +/// correctly as signaled when used by other event API functionality. +/// - The application must ensure the command list and events were created +/// on the same context. +/// - The application must **not** call this function from simultaneous +/// threads with the same command list handle. +/// - The implementation of this function should be lock-free. +/// - This function allows to pass additional parameters in the form of +/// ::ze_base_desc_t . +/// - This function acts like ::zeCommandListAppendSignalEvent when passing +/// `NULL` value to `pNext`. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` +/// + `nullptr == hEvent` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + when passed additional parameters are invalid or incompatible with the device or command list +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListAppendSignalEventWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + ze_event_handle_t hEvent ///< [in] handle of the event + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Appends wait on event(s) on the device into a command list. /// @@ -6138,6 +6265,8 @@ zeCommandListAppendSignalEvent( /// - The application must **not** call this function from simultaneous /// threads with the same command list handle. /// - The implementation of this function should be lock-free. +/// - Passing additional parameters is possible with +/// ::zeCommandListAppendWaitOnEventsWithParameters function. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -6166,6 +6295,56 @@ zeCommandListAppendWaitOnEvents( ///< continuing ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Appends wait on event(s) on the device into a command list and allows +/// to pass additional parameters. +/// +/// @details +/// - The application must ensure the events are accessible by the device on +/// which the command list was created. +/// - For counter-based events, the device on which the command list was +/// created must have peer-to-peer access to the device that last signaled +/// the event. Unlike signaling, waiting on a counter-based event does not +/// re-associate it with another device. +/// - The application must ensure the command list and events were created +/// on the same context. +/// - The application must **not** call this function from simultaneous +/// threads with the same command list handle. +/// - The implementation of this function should be lock-free. +/// - This function allows to pass additional parameters in the form of +/// ::ze_base_desc_t . +/// - This function acts like ::zeCommandListAppendWaitOnEvents when passing +/// `NULL` value to `pNext`. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phEvents` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + when passed additional parameters are invalid or incompatible with the device or command list +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandListAppendWaitOnEventsWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + uint32_t numEvents, ///< [in] number of events to wait on before continuing + ze_event_handle_t* phEvents ///< [in][range(0, numEvents)] handles of the events to wait on before + ///< continuing + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Signals a event from host. /// @@ -7586,7 +7765,10 @@ zeMemGetAddressRange( /// mapping is required in the sending process. /// - Only one physical memory object may be associated with a single IPC /// handle at a time; the virtual address range passed must map to exactly -/// one physical memory object. +/// one physical memory object, unless a +/// ::ze_ipc_phys_mem_handle_range_ext_desc_t is chained via `pNext` to +/// capture a range spanning multiple physical memory objects into a +/// single IPC handle. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// @@ -7698,6 +7880,11 @@ zeMemGetFileDescriptorFromIpcHandleExp( /// the IPC handle. /// For instance, it may close the file descriptor contained in the IPC /// handle, if such type of handle is being used by the driver. +/// - When the IPC handle encodes multiple physical memory objects (for +/// example, a handle representing a range of objects), the driver +/// releases **all** of the underlying resources it holds for that handle, +/// not just one; for instance, it closes every file descriptor the driver +/// opened to represent the encoded objects. /// - This call does not free the original allocation for which the IPC /// handle was created. /// - This function may **not** be called from simultaneous threads with the @@ -7808,6 +7995,16 @@ zeMemOpenIpcHandle( /// @details /// - Closes an IPC memory handle by unmapping memory that was opened in /// this process using ::zeMemOpenIpcHandle. +/// - `ptr` must be the base pointer returned by ::zeMemOpenIpcHandle; +/// passing an interior address is not valid. +/// - This call unmaps every physical memory object that +/// ::zeMemOpenIpcHandle mapped for this pointer and frees any virtual +/// address reservation the driver created on the caller's behalf to back +/// it. When the handle encoded a range of multiple physical objects, all +/// of those objects are unmapped by this single call. The application +/// never reserved this address range and must not attempt to release it +/// with ::zeVirtualMemFree; this call leaves no mappings or virtual +/// address reservation behind. /// - The application must **not** call this function from simultaneous /// threads with the same pointer. /// - The implementation of this function must be thread-safe. @@ -7895,6 +8092,8 @@ typedef struct _ze_external_memory_import_fd_t /// memory as a file descriptor. /// - The requested memory export type must have been specified when the /// allocation was made. +/// - The returned `fd` is owned by the driver. The application must not +/// close it directly. typedef struct _ze_external_memory_export_fd_t { ze_structure_type_t stype; ///< [in] type of this structure @@ -7903,6 +8102,7 @@ typedef struct _ze_external_memory_export_fd_t ze_external_memory_type_flags_t flags; ///< [in] flags specifying the memory export type for the file descriptor. ///< must be 0 (default) or a valid combination of ::ze_external_memory_type_flags_t int fd; ///< [out] the exported file descriptor handle representing the allocation. + ///< Owned by the driver; must not be closed directly by the application. } ze_external_memory_export_fd_t; @@ -8536,6 +8736,36 @@ zeModuleGetProperties( ze_module_properties_t* pModuleProperties ///< [in,out] query result for module properties. ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieve the handle of the device on which the module was created. +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hModule` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phDevice` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeModuleGetDeviceHandle( + ze_module_handle_t hModule, ///< [in] handle of the module + ze_device_handle_t* phDevice ///< [out] handle of the device the module was created for + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Supported kernel creation flags typedef uint32_t ze_kernel_flags_t; @@ -9131,6 +9361,36 @@ zeKernelGetName( char* pName ///< [in,out][optional] char pointer to kernel name. ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieve the handle of the module from which the kernel was created. +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hKernel` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phModule` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeKernelGetModuleHandle( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel + ze_module_handle_t* phModule ///< [out] handle of the module the kernel was created from + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Kernel dispatch group count. typedef struct _ze_group_count_t @@ -9204,10 +9464,10 @@ zeCommandListAppendLaunchKernel( /// same command list handle. /// - The implementation of this function should be lock-free. /// - This function allows to pass additional parameters in the form of -/// `${x}_base_desc_t` +/// ::ze_base_desc_t . /// - This function can replace ::zeCommandListAppendLaunchCooperativeKernel /// with additional parameter -/// `${x}_command_list_append_launch_kernel_param_cooperative_desc_t` +/// ::ze_command_list_append_launch_kernel_param_cooperative_desc_t . /// - This function supports both immediate and regular command lists. /// /// @returns @@ -9272,10 +9532,10 @@ typedef struct _ze_group_size_t /// - The implementation of this function should be lock-free. /// - This function supports both immediate and regular command lists. /// - This function changes kernel state as if separate -/// ${x}KernelSetGroupSize and ${x}KernelSetArgumentValue functions were +/// ::zeKernelSetGroupSize and ::zeKernelSetArgumentValue functions were /// called. /// - This function allows to pass additional extensions in the form of -/// `${x}_base_desc_t` +/// ::ze_base_desc_t . /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -9298,8 +9558,8 @@ typedef struct _ze_group_size_t /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE /// + when passed additional extensions are invalid or incompatible with the device or command list -/// - ::ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION - "as per ${x}KernelSetGroupSize" -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT - "as per ${x}KernelSetArgumentValue" +/// - ::ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION - as per ::zeKernelSetGroupSize +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT - as per ::zeKernelSetArgumentValue ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendLaunchKernelWithArguments( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list @@ -11203,53 +11463,6 @@ typedef enum _ze_linkonce_odr_ext_version_t } ze_linkonce_odr_ext_version_t; -#if !defined(__GNUC__) -#pragma endregion -#endif -// Intel 'oneAPI' Level-Zero Extension for supporting power saving hint. -#if !defined(__GNUC__) -#pragma region powersavinghint -#endif -/////////////////////////////////////////////////////////////////////////////// -#ifndef ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME -/// @brief Power Saving Hint Extension Name -#define ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME "ZE_experimental_power_saving_hint" -#endif // ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Power Saving Hint Extension Version(s) -typedef enum _ze_power_saving_hint_exp_version_t -{ - ZE_POWER_SAVING_HINT_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 - ZE_POWER_SAVING_HINT_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version - ZE_POWER_SAVING_HINT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_POWER_SAVING_HINT_EXP_VERSION_* ENUMs - -} ze_power_saving_hint_exp_version_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Supported device types -typedef enum _ze_power_saving_hint_type_t -{ - ZE_POWER_SAVING_HINT_TYPE_MIN = 0, ///< Minimum power savings. The device will make no attempt to save power - ///< while executing work submitted to this context. - ZE_POWER_SAVING_HINT_TYPE_MAX = 100, ///< Maximum power savings. The device will do everything to bring power to - ///< a minimum while executing work submitted to this context. - ZE_POWER_SAVING_HINT_TYPE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_POWER_SAVING_HINT_TYPE_* ENUMs - -} ze_power_saving_hint_type_t; - -/////////////////////////////////////////////////////////////////////////////// -/// @brief Extended context descriptor containing power saving hint. -typedef struct _ze_context_power_saving_hint_exp_desc_t -{ - ze_structure_type_t stype; ///< [in] type of this structure - const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific - ///< structure (i.e. contains stype and pNext). - uint32_t hint; ///< [in] power saving hint (default value = 0). This is value from [0,100] - ///< and can use pre-defined settings from ::ze_power_saving_hint_type_t. - -} ze_context_power_saving_hint_exp_desc_t; - #if !defined(__GNUC__) #pragma endregion #endif @@ -16574,7 +16787,10 @@ typedef struct _ze_ipc_mem_handle_type_ext_desc_t /// handle represents the underlying physical memory object. /// - Only one physical memory object may be associated with a single IPC /// handle at a time; the virtual address range passed must map to exactly -/// one physical memory object. +/// one physical memory object, unless a +/// ::ze_ipc_phys_mem_handle_range_ext_desc_t is chained via `pNext` to +/// capture a range spanning multiple physical memory objects into a +/// single IPC handle. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// @@ -16931,9 +17147,9 @@ zeCommandListIsGraphCaptureEnabledExt( /// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == phGraph` -/// - $ZE_RESULT_ERROR_GRAPH_UNJOINED_FORKS +/// - ::ZE_RESULT_ERROR_GRAPH_UNJOINED_FORKS /// + if graph contains unjoined forks -/// - $ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING +/// - ::ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING /// + if command list is not in graph capture mode ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListEndGraphCaptureExt( @@ -16974,7 +17190,7 @@ zeCommandListEndGraphCaptureExt( /// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == phGraph` -/// - $ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING +/// - ::ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING /// + if command list is not in graph capture mode ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListGetGraphExt( @@ -17077,6 +17293,11 @@ zeGraphSetDestructionCallbackExt( /// - Resources used in captured commands (e.g. buffers passed to kernels as /// arguments) are shared between instances; the application is /// responsible for avoiding data races during concurrent execution. +/// - The function returns `ZE_RESULT_ERROR_INVALID_GRAPH` when the recorded +/// graph is invalid, for example when it contains forks that were never +/// joined back to the primary command list. +/// - The function returns `ZE_RESULT_ERROR_INVALID_ARGUMENT` when graph +/// capture has not been ended with ::zeCommandListEndGraphCaptureExt. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -17096,6 +17317,7 @@ zeGraphSetDestructionCallbackExt( /// + `nullptr == hGraph` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == phExecutableGraph` +/// - ::ZE_RESULT_ERROR_INVALID_GRAPH ZE_APIEXPORT ze_result_t ZE_APICALL zeGraphInstantiateExt( ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph @@ -17308,6 +17530,86 @@ zeGraphDestroyExt( ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Pauses recording to the specified graph. Affected immediate command +/// lists (both primary command lists and child command lists from which +/// graph was recording) can be reused for any purpose during this pause +/// without affecting the paused recording. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hGraph` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + Graph is not in a recording state +ZE_APIEXPORT ze_result_t ZE_APICALL +zeGraphPauseCaptureExt( + ze_graph_handle_t hGraph ///< [in] handle to the graph to pause capture + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Resumes capturing commands to the graph after a pause. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hGraph` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + Graph is not in a paused state +ZE_APIEXPORT ze_result_t ZE_APICALL +zeGraphResumeCaptureExt( + ze_graph_handle_t hGraph ///< [in] handle to the graph to resume capture + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Gets monotonically increasing, process-unique ID of the graph. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hGraph` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pGraphId` +ZE_APIEXPORT ze_result_t ZE_APICALL +zeGraphGetIdExt( + ze_graph_handle_t hGraph, ///< [in] handle to the graph + uint64_t* pGraphId ///< [out] pointer to the memory where the graph ID will be written + ); + #if !defined(__GNUC__) #pragma endregion #endif @@ -17435,6 +17737,478 @@ typedef struct _ze_device_readonly_memory_ext_properties_t } ze_device_readonly_memory_ext_properties_t; +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for Command Queue Set Priority +#if !defined(__GNUC__) +#pragma region commandQueueSetPriority +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_COMMAND_QUEUE_SET_PRIORITY_EXT_NAME +/// @brief Command Queue Set Priority Extension Name +#define ZE_COMMAND_QUEUE_SET_PRIORITY_EXT_NAME "ZE_extension_command_queue_set_priority" +#endif // ZE_COMMAND_QUEUE_SET_PRIORITY_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Command Queue Set Priority Extension Version(s) +typedef enum _ze_command_queue_set_priority_ext_version_t +{ + ZE_COMMAND_QUEUE_SET_PRIORITY_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ),///< version 1.0 + ZE_COMMAND_QUEUE_SET_PRIORITY_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ),///< latest known version + ZE_COMMAND_QUEUE_SET_PRIORITY_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_COMMAND_QUEUE_SET_PRIORITY_EXT_VERSION_* ENUMs + +} ze_command_queue_set_priority_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Sets the priority of a command queue. +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - This function changes the priority of an existing command queue, +/// overriding the priority specified at creation through +/// ::ze_command_queue_desc_t; the updated value is reported by +/// ::zeCommandQueueGetPriority. +/// - Whether the new priority affects commands already submitted to the +/// command queue, or only commands submitted after this call, is +/// implementation-defined. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandQueue` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < priority` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +ZE_APIEXPORT ze_result_t ZE_APICALL +zeCommandQueueSetPriorityExt( + ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t priority ///< [in] priority to set for the command queue + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero APIs for Compiler-Info Query +#if !defined(__GNUC__) +#pragma region compilerInfoQuery +#endif +/////////////////////////////////////////////////////////////////////////////// +/// @brief Compiler-info list selected by ::zeDeviceGetCompilerInfo +typedef enum _ze_device_compiler_info_t +{ + ZE_DEVICE_COMPILER_INFO_SPIRV_CAPABILITIES = 1, ///< Supported SPIR-V capabilities, as an array of uint32_t numeric + ///< capability identifiers + ZE_DEVICE_COMPILER_INFO_SPIRV_EXTENSIONS = 2, ///< Supported SPIR-V extensions, as an array of null-terminated names, + ///< each ::ZE_MAX_EXTENSION_NAME bytes + ZE_DEVICE_COMPILER_INFO_COMPILER_OPTIONS = 3, ///< Supported compiler options, as a single null-terminated string of + ///< space-separated tokens + ZE_DEVICE_COMPILER_INFO_DRIVER_OPTIONS = 4, ///< Supported driver options, as a single null-terminated string of + ///< space-separated tokens + ZE_DEVICE_COMPILER_INFO_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_COMPILER_INFO_* ENUMs + +} ze_device_compiler_info_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Name and version entry returned for the OpenCL C compiler-info lists +typedef struct _ze_compiler_name_version_t +{ + uint32_t version; ///< [out] packed version of the entry + char name[ZE_MAX_EXTENSION_NAME]; ///< [out] null-terminated name + +} ze_compiler_name_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieves compiler-specific information for the device, selected by an +/// enumerated type. +/// +/// @details +/// - This query is scoped to compiler-specific data. +/// - The paramName parameter selects data to be queried. Data layout is +/// documented along with respective paramName enum entry. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_DEVICE_COMPILER_INFO_DRIVER_OPTIONS < paramName` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pSize` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + an extension passed via pNext is not supported +ZE_APIEXPORT ze_result_t ZE_APICALL +zeDeviceGetCompilerInfo( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_device_compiler_info_t paramName, ///< [in] compiler-info to return + const void* pNext, ///< [in][optional] additional extensions passed to the function + size_t* pSize, ///< [in,out] pointer to the size in bytes of the result. + ///< If size is zero, then the driver shall update the value with the total + ///< size in bytes needed. + ///< If size is less than the total size needed, then the driver shall + ///< update the value with the required size and shall not write to pData. + void* pData ///< [in,out][optional][range(0, *pSize)] pointer to the result buffer. + ///< If pData is nullptr, then only the required size is returned in pSize. + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for declaring the application-supported API version at initialization +#if !defined(__GNUC__) +#pragma region initDriverAppVersion +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_INIT_DRIVER_APP_VERSION_EXT_NAME +/// @brief Init Driver Application Version Extension Name +#define ZE_INIT_DRIVER_APP_VERSION_EXT_NAME "ZE_extension_init_driver_app_version" +#endif // ZE_INIT_DRIVER_APP_VERSION_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Init Driver Application Version Extension Version(s) +typedef enum _ze_init_driver_app_version_ext_version_t +{ + ZE_INIT_DRIVER_APP_VERSION_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_INIT_DRIVER_APP_VERSION_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_INIT_DRIVER_APP_VERSION_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_INIT_DRIVER_APP_VERSION_EXT_VERSION_* ENUMs + +} ze_init_driver_app_version_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Declares the maximum core API version supported by the application +/// +/// @details +/// - This structure may be passed to ::zeInitDrivers, via the `pNext` +/// member of ::ze_init_driver_type_desc_t, to declare the maximum core +/// API version the application was built against and is able to handle. +/// - 'oneAPI' Level-Zero otherwise provides no mechanism for an application +/// to communicate the API version it supports to a driver; +/// ::zeDriverGetApiVersion only reports the version supported by the +/// driver, not the application. A driver may use the application-declared +/// version to gate version-dependent behavior for backward compatibility, +/// for example only reporting enumerants or memory types introduced in +/// newer API versions to applications that understand them. +/// - If this structure is not provided, the driver must assume the +/// application supports only the baseline behavior and must not rely on +/// any version-gated behavior being understood by the application. +/// - A driver should clamp version-gated behavior to the minimum of the +/// version it supports and the version the application declares. +typedef struct _ze_init_driver_app_version_ext_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + ze_api_version_t apiVersionHint; ///< [in] maximum core 'oneAPI' Level-Zero API version supported by the + ///< application. + +} ze_init_driver_app_version_ext_desc_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for exporting a virtual address range as a single IPC memory handle. +#if !defined(__GNUC__) +#pragma region ipcPhysMemRange +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_NAME +/// @brief IPC Physical Memory Range Extension Name +#define ZE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_NAME "ZE_extension_ipc_phys_mem_handle_range" +#endif // ZE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief IPC Physical Memory Range Extension Version(s) +typedef enum _ze_ipc_phys_mem_handle_range_ext_version_t +{ + ZE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_VERSION_* ENUMs + +} ze_ipc_phys_mem_handle_range_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Descriptor for capturing a VA range into an IPC memory handle. +/// +/// @details +/// - Pass this structure via the `pNext` parameter of +/// ::zeMemGetIpcHandleWithProperties. When present, the `ptr` argument +/// specifies the base VA of the range rather than the base of a single +/// allocation. +/// - The `ptr` argument of ::zeMemGetIpcHandleWithProperties specifies the +/// base VA of the range. +/// - The range may span more than one reserved VA region created by +/// ::zeVirtualMemReserve; the underlying reservations are not +/// significant. What is captured is the ordered set of physical memory +/// objects mapped along `[ptr, ptr+size)`. +/// - The caller may start at an arbitrary offset within a mapped range and +/// may capture a subset of a larger mapped range, provided the requested +/// `[ptr, ptr+size)` is itself fully and contiguously mapped. +/// - An individual physical memory object along the range need not be +/// mapped at its own offset zero; ::zeVirtualMemMap may have mapped it at +/// a non-zero offset into the physical object. The export captures the +/// offset at which each physical object was mapped, and the importer +/// reproduces each mapping at that same offset, so the importer views +/// exactly the same memory as the exporter. +/// - This extension is only supported for ranges backed by virtual +/// reservations (::zeVirtualMemReserve) mapped to physical memory objects +/// (::zeVirtualMemMap). Device, host, and shared USM pointers (from +/// ::zeMemAllocDevice, ::zeMemAllocHost, and ::zeMemAllocShared) are not +/// supported and will not be grouped into a range handle. If `[ptr, +/// ptr+size)` includes any standard USM VA rather than a reserved VA, +/// ::zeMemGetIpcHandleWithProperties returns +/// ::ZE_RESULT_ERROR_INVALID_ARGUMENT. +/// - The driver enumerates all physical memory objects mapped to `[ptr, +/// ptr+size)` and encodes them into the returned IPC handle in VA order. +/// - On the importer side, ::zeMemOpenIpcHandle decodes the handle and maps +/// all physical objects into a fresh contiguous VA reservation in the +/// same order. +/// - The total addressable size on the importer equals `size`. When `ptr` +/// begins at an offset within a physical memory object, the returned +/// importer pointer corresponds to `ptr`, not to the base of the first +/// encoded object. +/// - The importer does not need to be told `size` out of band: the range +/// handle is self-describing. Calling ::zeMemGetAddressRange on the +/// pointer returned by ::zeMemOpenIpcHandle reports the base and full +/// `size` of the imported range. +/// - The exported IPC handle is a static snapshot taken at the time of the +/// call. Physical memory subsequently mapped into, unmapped from, or +/// grown beyond the exporter's VA range is not reflected in a previously +/// exported handle or in any already-open importer view; a new export is +/// required to share the additional mappings. +/// - There is no application-visible limit on the number of physical memory +/// objects a range may encode; how the driver represents and stores them +/// is opaque and is not bound by the size of ::ze_ipc_mem_handle_t. If +/// the driver cannot accommodate the range, for example it cannot store +/// the number of physical objects being represented, +/// ::zeMemGetIpcHandleWithProperties fails with +/// ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE. +/// - Returns ::ZE_RESULT_ERROR_ADDRESS_NOT_FOUND if any sub-region within +/// `[ptr, ptr+size)` is not mapped to a physical memory object. The range +/// must be fully mapped with no holes, because the importer is guaranteed +/// a contiguous range and unmapped gaps cannot be represented. +/// - Returns ::ZE_RESULT_ERROR_INVALID_SIZE if `size` is 0. +/// - Returns ::ZE_RESULT_ERROR_UNSUPPORTED_SIZE if the driver cannot +/// accommodate the range, for example the number of physical memory +/// objects encoded exceeds what the implementation can store. +/// - Returns ::ZE_RESULT_ERROR_INVALID_NULL_POINTER if the `ptr` argument +/// is NULL. +/// - Returns ::ZE_RESULT_ERROR_INVALID_ARGUMENT if `[ptr, ptr+size)` +/// includes a device, host, or shared USM allocation rather than reserved +/// VA mapped to physical memory. +/// - Returns ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE if the driver or device +/// does not support the ::ZE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_NAME +/// extension. +typedef struct _ze_ipc_phys_mem_handle_range_ext_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + size_t size; ///< [in] size in bytes of the VA range starting at the `ptr` argument of + ///< ::zeMemGetIpcHandleWithProperties; must be non-zero. The range + ///< [ptr, ptr+size) must be fully mapped; see the details for error behavior. + +} ze_ipc_phys_mem_handle_range_ext_desc_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension APIs for NPU Device Properties +#if !defined(__GNUC__) +#pragma region npuProperties +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_DEVICE_NPU_PROPERTIES_EXT_NAME +/// @brief NPU Device Properties Extension Name +#define ZE_DEVICE_NPU_PROPERTIES_EXT_NAME "ZE_extension_device_npu_properties" +#endif // ZE_DEVICE_NPU_PROPERTIES_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief NPU Device Properties Extension Version(s) +typedef enum _ze_device_npu_properties_ext_version_t +{ + ZE_DEVICE_NPU_PROPERTIES_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_DEVICE_NPU_PROPERTIES_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_DEVICE_NPU_PROPERTIES_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_DEVICE_NPU_PROPERTIES_EXT_VERSION_* ENUMs + +} ze_device_npu_properties_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief NPU device properties queried using ::zeDeviceGetProperties +/// +/// @details +/// - This structure may be returned from ::zeDeviceGetProperties via the +/// `pNext` member of ::ze_device_properties_t. +/// - Applicable only when the `type` member of ::ze_device_properties_t is +/// ::ZE_DEVICE_TYPE_VPU. +/// - Exposes NPU-native topology, clock, timestamp frequency, on-chip SRAM, +/// and compiler capability information that has no clean analogue in the +/// GPU-oriented base ::ze_device_properties_t struct. +/// - `compilerVersion` and `maxOVOpsetVersionSupported` describe the +/// compiler bundled with the driver, and report identical values for +/// every device reported by a given driver instance. +/// - The base ::ze_device_properties_t fields remain populated on NPU +/// devices for backward compatibility with consumers that predate this +/// extension. New consumers should prefer the NPU-native fields exposed +/// here. +/// - Identity (`vendorId`, `deviceId`, `subdeviceId`, `uuid`, `name`), +/// capabilities (`flags`, `maxMemAllocSize`, `maxHardwareContexts`, +/// `maxCommandQueuePriority`), and host/global timestamp validity +/// (`timestampValidBits`) continue to be sourced from the base +/// ::ze_device_properties_t struct. NPU does not implement kernel +/// timestamp APIs; `kernelTimestampValidBits` is 0 on NPU devices. +typedef struct _ze_device_npu_properties_ext_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint32_t tileCount; ///< [out] Total number of NCE tiles enabled on the device. Equivalent to + ///< popcount(tileEnableMask). Supersedes the `numSlices` member of + ///< ::ze_device_properties_t for NPU devices. + uint32_t tileEnableMask; ///< [out] Bitmask of enabled NCE tiles. popcount(tileEnableMask) == + ///< tileCount. + uint32_t totalShaveCount; ///< [out] Total number of SHAVE (VLIW) vector processors across all tiles. + ///< Supersedes the `numEUsPerSubslice` member of ::ze_device_properties_t + ///< for NPU devices. + uint32_t int8x8MacsPerTile; ///< [out] Multiply-accumulate (MAC) units per tile at INT8 x INT8 + ///< precision (baseline). Throughput at other precisions: 2x for INT8 x + ///< INT4, 0.5x for FP16 x FP16, 0.5x for INT16 x INT8, 1x for INT16 x + ///< INT4. Supersedes half the `physicalEUSimdWidth` member of + ///< ::ze_device_properties_t for NPU devices. + uint32_t totalDpuMacs; ///< [out] Total DPU MAC units across the device. Derived as tileCount * + ///< int8x8MacsPerTile. + uint32_t numComputeEngines; ///< [out] Number of compute engines on the device. + uint32_t numCopyEngines; ///< [out] Number of copy (DMA) engines on the device. + uint64_t dpuClockRateHz; ///< [out] DPU compute clock rate, in Hz. Supersedes the `coreClockRate` + ///< member of ::ze_device_properties_t for NPU devices. + uint64_t timestampFreqHz; ///< [out] Device timestamp counter frequency, in Hz. Used to convert raw + ///< device tick counts returned by ::zeDeviceGetGlobalTimestamps and + ///< ::zeCommandListAppendWriteGlobalTimestamp into time durations. + uint64_t nnSramSizeBytes; ///< [out] On-chip CMX SRAM size for neural network workloads, in bytes. + uint32_t compilerVersion; ///< [out] Version of the NPU compiler bundled with this driver, using + ///< ::ZE_MAKE_VERSION. Use ::ZE_MAJOR_VERSION and ::ZE_MINOR_VERSION to + ///< extract the major and minor components. + uint32_t maxOVOpsetVersionSupported; ///< [out] Maximum OpenVINO opset version supported by the bundled NPU + ///< compiler. + +} ze_device_npu_properties_ext_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Extension for supporting power saving hint. +#if !defined(__GNUC__) +#pragma region powersavinghint +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_CONTEXT_POWER_SAVING_HINT_EXT_NAME +/// @brief Power Saving Hint Extension Name +#define ZE_CONTEXT_POWER_SAVING_HINT_EXT_NAME "ZE_extension_power_saving_hint" +#endif // ZE_CONTEXT_POWER_SAVING_HINT_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Power Saving Hint Extension Version(s) +typedef enum _ze_power_saving_hint_ext_version_t +{ + ZE_POWER_SAVING_HINT_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_POWER_SAVING_HINT_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_POWER_SAVING_HINT_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_POWER_SAVING_HINT_EXT_VERSION_* ENUMs + +} ze_power_saving_hint_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported device types +typedef enum _ze_power_saving_hint_ext_type_t +{ + ZE_POWER_SAVING_HINT_EXT_TYPE_MIN = 0, ///< Minimum power savings. The device will make no attempt to save power + ///< while executing work submitted to this context. + ZE_POWER_SAVING_HINT_EXT_TYPE_MAX = 100, ///< Maximum power savings. The device will do everything to bring power to + ///< a minimum while executing work submitted to this context. + ZE_POWER_SAVING_HINT_EXT_TYPE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_POWER_SAVING_HINT_EXT_TYPE_* ENUMs + +} ze_power_saving_hint_ext_type_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Extended context descriptor containing power saving hint. +typedef struct _ze_context_power_saving_hint_ext_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint32_t hint; ///< [in] power saving hint (default value = 0). This is value from [0,100] + ///< and can use pre-defined settings from ::ze_power_saving_hint_ext_type_t. + +} ze_context_power_saving_hint_ext_desc_t; + +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME +/// @brief Power Saving Hint Extension Name. @deprecated since 1.18: Use +/// ::ZE_CONTEXT_POWER_SAVING_HINT_EXT_NAME instead. +#define ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME "ZE_experimental_power_saving_hint" +#endif // ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Power Saving Hint Extension Version(s). @deprecated since 1.18: Use +/// ::ze_context_power_saving_hint_ext_desc_t instead. +typedef enum _ze_power_saving_hint_exp_version_t +{ + ZE_POWER_SAVING_HINT_EXP_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZE_POWER_SAVING_HINT_EXP_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZE_POWER_SAVING_HINT_EXP_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_POWER_SAVING_HINT_EXP_VERSION_* ENUMs + +} ze_power_saving_hint_exp_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Supported device types. @deprecated since 1.18: Use +/// ::ze_power_saving_hint_ext_type_t instead. +typedef enum _ze_power_saving_hint_type_t +{ + ZE_POWER_SAVING_HINT_TYPE_MIN = 0, ///< Minimum power savings. The device will make no attempt to save power + ///< while executing work submitted to this context. + ZE_POWER_SAVING_HINT_TYPE_MAX = 100, ///< Maximum power savings. The device will do everything to bring power to + ///< a minimum while executing work submitted to this context. + ZE_POWER_SAVING_HINT_TYPE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZE_POWER_SAVING_HINT_TYPE_* ENUMs + +} ze_power_saving_hint_type_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Extended context descriptor containing power saving hint. @deprecated +/// since 1.18: Use ::ze_context_power_saving_hint_ext_desc_t instead. +typedef struct _ze_context_power_saving_hint_exp_desc_t +{ + ze_structure_type_t stype; ///< [in] type of this structure + const void* pNext; ///< [in][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint32_t hint; ///< [in] power saving hint (default value = 0). This is value from [0,100] + ///< and can use pre-defined settings from ::ze_power_saving_hint_type_t. + +} ze_context_power_saving_hint_exp_desc_t; + #if !defined(__GNUC__) #pragma endregion #endif diff --git a/include/ze_ddi.h b/include/ze_ddi.h index 580ad2c2..3262234f 100644 --- a/include/ze_ddi.h +++ b/include/ze_ddi.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT * * @file ze_ddi.h - * @version v1.17-r1.17.24 + * @version v1.18-r1.18.31 * */ #ifndef _ZE_DDI_H @@ -678,6 +678,16 @@ typedef ze_result_t (ZE_APICALL *ze_pfnDeviceGetCounterBasedEventMaxValue_t)( uint64_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeDeviceGetCompilerInfo +typedef ze_result_t (ZE_APICALL *ze_pfnDeviceGetCompilerInfo_t)( + ze_device_handle_t, + ze_device_compiler_info_t, + const void*, + size_t*, + void* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of Device functions pointers typedef struct _ze_device_dditable_t @@ -710,6 +720,7 @@ typedef struct _ze_device_dditable_t ze_pfnDeviceGetRuntimeRequirementsKey_t pfnGetRuntimeRequirementsKey; ze_pfnDeviceValidateRuntimeRequirements_t pfnValidateRuntimeRequirements; ze_pfnDeviceGetCounterBasedEventMaxValue_t pfnGetCounterBasedEventMaxValue; + ze_pfnDeviceGetCompilerInfo_t pfnGetCompilerInfo; } ze_device_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -944,6 +955,13 @@ typedef ze_result_t (ZE_APICALL *ze_pfnCommandQueueGetPriority_t)( ze_command_queue_priority_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandQueueSetPriorityExt +typedef ze_result_t (ZE_APICALL *ze_pfnCommandQueueSetPriorityExt_t)( + ze_command_queue_handle_t, + ze_command_queue_priority_t + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of CommandQueue functions pointers typedef struct _ze_command_queue_dditable_t @@ -957,6 +975,7 @@ typedef struct _ze_command_queue_dditable_t ze_pfnCommandQueueGetFlags_t pfnGetFlags; ze_pfnCommandQueueGetMode_t pfnGetMode; ze_pfnCommandQueueGetPriority_t pfnGetPriority; + ze_pfnCommandQueueSetPriorityExt_t pfnSetPriorityExt; } ze_command_queue_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -1496,6 +1515,23 @@ typedef ze_result_t (ZE_APICALL *ze_pfnCommandListAppendHostFunction_t)( ze_event_handle_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandListAppendSignalEventWithParameters +typedef ze_result_t (ZE_APICALL *ze_pfnCommandListAppendSignalEventWithParameters_t)( + ze_command_list_handle_t, + const void *, + ze_event_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeCommandListAppendWaitOnEventsWithParameters +typedef ze_result_t (ZE_APICALL *ze_pfnCommandListAppendWaitOnEventsWithParameters_t)( + ze_command_list_handle_t, + const void *, + uint32_t, + ze_event_handle_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of CommandList functions pointers typedef struct _ze_command_list_dditable_t @@ -1552,6 +1588,8 @@ typedef struct _ze_command_list_dditable_t ze_pfnCommandListGetGraphExt_t pfnGetGraphExt; ze_pfnCommandListAppendGraphExt_t pfnAppendGraphExt; ze_pfnCommandListAppendHostFunction_t pfnAppendHostFunction; + ze_pfnCommandListAppendSignalEventWithParameters_t pfnAppendSignalEventWithParameters; + ze_pfnCommandListAppendWaitOnEventsWithParameters_t pfnAppendWaitOnEventsWithParameters; } ze_command_list_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -2482,6 +2520,13 @@ typedef ze_result_t (ZE_APICALL *ze_pfnModuleInspectLinkageExt_t)( ze_module_build_log_handle_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeModuleGetDeviceHandle +typedef ze_result_t (ZE_APICALL *ze_pfnModuleGetDeviceHandle_t)( + ze_module_handle_t, + ze_device_handle_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of Module functions pointers typedef struct _ze_module_dditable_t @@ -2495,6 +2540,7 @@ typedef struct _ze_module_dditable_t ze_pfnModuleGetProperties_t pfnGetProperties; ze_pfnModuleGetFunctionPointer_t pfnGetFunctionPointer; ze_pfnModuleInspectLinkageExt_t pfnInspectLinkageExt; + ze_pfnModuleGetDeviceHandle_t pfnGetDeviceHandle; } ze_module_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -2658,6 +2704,13 @@ typedef ze_result_t (ZE_APICALL *ze_pfnKernelGetName_t)( char* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeKernelGetModuleHandle +typedef ze_result_t (ZE_APICALL *ze_pfnKernelGetModuleHandle_t)( + ze_kernel_handle_t, + ze_module_handle_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of Kernel functions pointers typedef struct _ze_kernel_dditable_t @@ -2674,6 +2727,7 @@ typedef struct _ze_kernel_dditable_t ze_pfnKernelGetSourceAttributes_t pfnGetSourceAttributes; ze_pfnKernelGetProperties_t pfnGetProperties; ze_pfnKernelGetName_t pfnGetName; + ze_pfnKernelGetModuleHandle_t pfnGetModuleHandle; } ze_kernel_dditable_t; /////////////////////////////////////////////////////////////////////////////// @@ -3130,6 +3184,25 @@ typedef ze_result_t (ZE_APICALL *ze_pfnGraphDestroyExt_t)( ze_graph_handle_t ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGraphPauseCaptureExt +typedef ze_result_t (ZE_APICALL *ze_pfnGraphPauseCaptureExt_t)( + ze_graph_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGraphResumeCaptureExt +typedef ze_result_t (ZE_APICALL *ze_pfnGraphResumeCaptureExt_t)( + ze_graph_handle_t + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zeGraphGetIdExt +typedef ze_result_t (ZE_APICALL *ze_pfnGraphGetIdExt_t)( + ze_graph_handle_t, + uint64_t* + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of Graph functions pointers typedef struct _ze_graph_dditable_t @@ -3141,6 +3214,9 @@ typedef struct _ze_graph_dditable_t ze_pfnGraphIsEmptyExt_t pfnIsEmptyExt; ze_pfnGraphDumpContentsExt_t pfnDumpContentsExt; ze_pfnGraphDestroyExt_t pfnDestroyExt; + ze_pfnGraphPauseCaptureExt_t pfnPauseCaptureExt; + ze_pfnGraphResumeCaptureExt_t pfnResumeCaptureExt; + ze_pfnGraphGetIdExt_t pfnGetIdExt; } ze_graph_dditable_t; /////////////////////////////////////////////////////////////////////////////// diff --git a/include/ze_ddi_common.h b/include/ze_ddi_common.h index 8c58af0f..1ba9cd79 100644 --- a/include/ze_ddi_common.h +++ b/include/ze_ddi_common.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT * * @file ze_ddi_common.h - * @version v1.17-r1.17.24 + * @version v1.18-r1.18.31 * */ #ifndef _ZE_DDI_COMMON_H diff --git a/include/zer.py b/include/zer.py index b49058ad..f40be145 100644 --- a/include/zer.py +++ b/include/zer.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file zer.py - @version v1.17-r1.17.24 + @version v1.18-r1.18.31 """ import platform diff --git a/include/zer_api.h b/include/zer_api.h index 26623afb..7b46e173 100644 --- a/include/zer_api.h +++ b/include/zer_api.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT * * @file zer_api.h - * @version v1.17-r1.17.24 + * @version v1.18-r1.18.31 * */ #ifndef _ZER_API_H diff --git a/include/zer_ddi.h b/include/zer_ddi.h index de9b3e81..24e6158c 100644 --- a/include/zer_ddi.h +++ b/include/zer_ddi.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT * * @file zer_ddi.h - * @version v1.17-r1.17.24 + * @version v1.18-r1.18.31 * */ #ifndef _ZER_DDI_H diff --git a/include/zes.py b/include/zes.py index 64421320..21265214 100644 --- a/include/zes.py +++ b/include/zes.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file zes.py - @version v1.17-r1.17.24 + @version v1.18-r1.18.31 """ import platform @@ -176,6 +176,7 @@ class zes_structure_type_v(IntEnum): RAS_CONFIG_EXP = 0x00020016 ## ::zes_ras_config_exp_t OEM_SERIAL_ID_EXT_PROPERTIES = 0x00020017 ## ::zes_oem_serial_id_ext_properties_t DEVICE_EXT_STATE = 0x00020018 ## ::zes_device_ext_state_t + MEMORY_VENDOR_INFO_EXT_PROPERTIES = 0x00020019 ## ::zes_memory_vendor_info_ext_properties_t class zes_structure_type_t(c_int): def __str__(self): @@ -230,7 +231,11 @@ class zes_base_capability_t(Structure): ############################################################################### ## @brief Supported sysman initialization flags class zes_init_flags_v(IntEnum): - PLACEHOLDER = ZE_BIT(0) ## placeholder for future use + GPU_ONLY = ZE_BIT(0) ## Initialize sysman for GPU devices only + VPU_ONLY = ZE_BIT(1) ## Initialize sysman for VPU devices only + NO_DEVICES = ZE_BIT(2) ## Allows ::zesInit() to succeed when no devices are discovered. Device + ## discovery is deferred until the first call to ::zesDeviceGet(), in + ## case no devices can be discovered when ::zesInit() is called. class zes_init_flags_t(c_int): def __str__(self): @@ -1600,7 +1605,10 @@ def __str__(self): ############################################################################### -## @brief Memory properties +## @brief Memory properties. To get the memory vendor ID and memory vendor name, +## pNext member of this structure should point to an instance of +## ::zes_memory_vendor_info_ext_properties_t with its stype set to +## ::ZES_STRUCTURE_TYPE_MEMORY_VENDOR_INFO_EXT_PROPERTIES. class zes_mem_properties_t(Structure): _fields_ = [ ("stype", zes_structure_type_t), ## [in] type of this structure @@ -2116,6 +2124,8 @@ class zes_temp_sensors_v(IntEnum): GPU_BOARD = 6 ## The maximum temperature across all sensors in the GPU Board GPU_BOARD_MIN = 7 ## The minimum temperature across all sensors in the GPU Board VOLTAGE_REGULATOR = 8 ## The maximum temperature across all sensors in the Voltage Regulator + COMPOSITE = 9 ## The normalized temperature across the SOC, Memory and Voltage + ## Regulators at which shutdown will occur class zes_temp_sensors_t(c_int): def __str__(self): @@ -2706,6 +2716,8 @@ class zes_device_state_ext_flags_v(IntEnum): WEDGED = ZE_BIT(1) ## The device is wedged SURVIVABILITY = ZE_BIT(2) ## The device is in survivability mode FLASH_OVERRIDE = ZE_BIT(3) ## The device has flash override enabled + GPU_LOST = ZE_BIT(4) ## The GPU has fallen off the pci bus or is otherwise inaccessible + DRIVER_NOT_LOADED = ZE_BIT(5) ## No kernel driver is bound to the device class zes_device_state_ext_flags_t(c_int): def __str__(self): @@ -2719,7 +2731,8 @@ def __str__(self): ## - This structure may be returned from ::zesDeviceGetState via the ## `pNext` member of ::zes_device_state_t ## - Provides extended device state information including wedged state, -## survivability mode, and flash override status +## survivability mode, flash override status, GPU lost condition, and +## kernel driver binding status class zes_device_ext_state_t(Structure): _fields_ = [ ("stype", zes_structure_type_t), ## [in] type of this structure @@ -2764,6 +2777,80 @@ class zes_oem_serial_id_ext_properties_t(Structure): ("oemSerialId", c_char * ZES_OEM_SERIAL_ID_SIZE) ## [out] OEM serial ID for the device. ] +############################################################################### +## @brief Device Health Extension Name +ZES_DEVICE_HEALTH_EXT_NAME = "ZES_extension_device_health" + +############################################################################### +## @brief Device Health Extension Version(s) +class zes_device_health_ext_version_v(IntEnum): + _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 + CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version + +class zes_device_health_ext_version_t(c_int): + def __str__(self): + return str(zes_device_health_ext_version_v(self.value)) + + +############################################################################### +## @brief Device health status +## +## @details +## - Device health represents a comprehensive assessment of a device's +## reliability and expected performance in upcoming operations. +## - The health indicator is stored in non-volatile memory (NVM) and +## persists across resets and firmware updates. +class zes_device_health_status_ext_v(IntEnum): + OK = 0 ## Device is healthy with no known issues + WARNING = 1 ## Device may have issues, diagnostics recommended + CRITICAL = 2 ## Device should not be used until maintenance is performed + FAILED = 3 ## Permanent non-recoverable failure; FRU replacement required + +class zes_device_health_status_ext_t(c_int): + def __str__(self): + return str(zes_device_health_status_ext_v(self.value)) + + +############################################################################### +## @brief Memory Vendor Info Extension Name +ZES_MEMORY_VENDOR_INFO_EXT_NAME = "ZES_extension_memory_vendor_info" + +############################################################################### +## @brief Memory Vendor Info Extension Version(s) +class zes_memory_vendor_info_ext_version_v(IntEnum): + _1_0 = ZE_MAKE_VERSION( 1, 0 ) ## version 1.0 + CURRENT = ZE_MAKE_VERSION( 1, 0 ) ## latest known version + +class zes_memory_vendor_info_ext_version_t(c_int): + def __str__(self): + return str(zes_memory_vendor_info_ext_version_v(self.value)) + + +############################################################################### +## @brief Maximum memory vendor name string size +ZES_MEMORY_VENDOR_NAME_EXT_SIZE = 256 + +############################################################################### +## @brief Memory Vendor Info Extension Properties structure +## +## @details +## - This structure can be passed as an extension structure to +## ::zesMemoryGetProperties via pNext member +## - Returns the memory vendor ID and the memory vendor name +class zes_memory_vendor_info_ext_properties_t(Structure): + _fields_ = [ + ("stype", zes_structure_type_t), ## [in] type of this structure + ("pNext", c_void_p), ## [in,out][optional] must be null or a pointer to an extension-specific + ## structure (i.e. contains stype and pNext). + ("vendorId", c_ulong), ## [out] Memory vendor ID for the device. A value of 0 indicates that the + ## memory vendor ID could not be determined. + ("length", c_ushort), ## [out] Length of the memory vendor name, excluding the null terminator. + ## A value of 0 indicates that the memory vendor name could not be + ## determined. + ("vendorName", c_char * ZES_MEMORY_VENDOR_NAME_EXT_SIZE) ## [out] Memory vendor name for the device (NULL terminated string + ## value). + ] + ############################################################################### __use_win_types = "Windows" == platform.uname()[0] @@ -3048,6 +3135,20 @@ class _zes_global_dditable_t(Structure): else: _zesDevicePciLinkSpeedUpdateExt_t = CFUNCTYPE( ze_result_t, zes_device_handle_t, ze_bool_t, POINTER(zes_device_action_t) ) +############################################################################### +## @brief Function-pointer for zesDeviceGetHealthStatusExt +if __use_win_types: + _zesDeviceGetHealthStatusExt_t = WINFUNCTYPE( ze_result_t, zes_device_handle_t, POINTER(zes_device_health_status_ext_t) ) +else: + _zesDeviceGetHealthStatusExt_t = CFUNCTYPE( ze_result_t, zes_device_handle_t, POINTER(zes_device_health_status_ext_t) ) + +############################################################################### +## @brief Function-pointer for zesDeviceSetHealthStatusExt +if __use_win_types: + _zesDeviceSetHealthStatusExt_t = WINFUNCTYPE( ze_result_t, zes_device_handle_t, zes_device_health_status_ext_t ) +else: + _zesDeviceSetHealthStatusExt_t = CFUNCTYPE( ze_result_t, zes_device_handle_t, zes_device_health_status_ext_t ) + ############################################################################### ## @brief Table of Device functions pointers @@ -3090,7 +3191,9 @@ class _zes_device_dditable_t(Structure): ("pfnReadOverclockState", c_void_p), ## _zesDeviceReadOverclockState_t ("pfnEnumOverclockDomains", c_void_p), ## _zesDeviceEnumOverclockDomains_t ("pfnResetExt", c_void_p), ## _zesDeviceResetExt_t - ("pfnPciLinkSpeedUpdateExt", c_void_p) ## _zesDevicePciLinkSpeedUpdateExt_t + ("pfnPciLinkSpeedUpdateExt", c_void_p), ## _zesDevicePciLinkSpeedUpdateExt_t + ("pfnGetHealthStatusExt", c_void_p), ## _zesDeviceGetHealthStatusExt_t + ("pfnSetHealthStatusExt", c_void_p) ## _zesDeviceSetHealthStatusExt_t ] ############################################################################### @@ -4289,6 +4392,8 @@ def __init__(self, version : ze_api_version_t): self.zesDeviceEnumOverclockDomains = _zesDeviceEnumOverclockDomains_t(self.__dditable.Device.pfnEnumOverclockDomains) self.zesDeviceResetExt = _zesDeviceResetExt_t(self.__dditable.Device.pfnResetExt) self.zesDevicePciLinkSpeedUpdateExt = _zesDevicePciLinkSpeedUpdateExt_t(self.__dditable.Device.pfnPciLinkSpeedUpdateExt) + self.zesDeviceGetHealthStatusExt = _zesDeviceGetHealthStatusExt_t(self.__dditable.Device.pfnGetHealthStatusExt) + self.zesDeviceSetHealthStatusExt = _zesDeviceSetHealthStatusExt_t(self.__dditable.Device.pfnSetHealthStatusExt) # call driver to get function pointers _DeviceExp = _zes_device_exp_dditable_t() diff --git a/include/zes_api.h b/include/zes_api.h index d05cd99d..87058f80 100644 --- a/include/zes_api.h +++ b/include/zes_api.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT * * @file zes_api.h - * @version v1.17-r1.17.24 + * @version v1.18-r1.18.31 * */ #ifndef _ZES_API_H @@ -169,6 +169,7 @@ typedef enum _zes_structure_type_t ZES_STRUCTURE_TYPE_RAS_CONFIG_EXP = 0x00020016, ///< ::zes_ras_config_exp_t ZES_STRUCTURE_TYPE_OEM_SERIAL_ID_EXT_PROPERTIES = 0x00020017, ///< ::zes_oem_serial_id_ext_properties_t ZES_STRUCTURE_TYPE_DEVICE_EXT_STATE = 0x00020018, ///< ::zes_device_ext_state_t + ZES_STRUCTURE_TYPE_MEMORY_VENDOR_INFO_EXT_PROPERTIES = 0x00020019, ///< ::zes_memory_vendor_info_ext_properties_t ZES_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_STRUCTURE_TYPE_* ENUMs } zes_structure_type_t; @@ -603,6 +604,10 @@ typedef struct _zes_device_ext_state_t zes_device_ext_state_t; /// @brief Forward-declare zes_oem_serial_id_ext_properties_t typedef struct _zes_oem_serial_id_ext_properties_t zes_oem_serial_id_ext_properties_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Forward-declare zes_memory_vendor_info_ext_properties_t +typedef struct _zes_memory_vendor_info_ext_properties_t zes_memory_vendor_info_ext_properties_t; + #if !defined(__GNUC__) #pragma endregion @@ -616,7 +621,11 @@ typedef struct _zes_oem_serial_id_ext_properties_t zes_oem_serial_id_ext_propert typedef uint32_t zes_init_flags_t; typedef enum _zes_init_flag_t { - ZES_INIT_FLAG_PLACEHOLDER = ZE_BIT(0), ///< placeholder for future use + ZES_INIT_FLAG_GPU_ONLY = ZE_BIT(0), ///< Initialize sysman for GPU devices only + ZES_INIT_FLAG_VPU_ONLY = ZE_BIT(1), ///< Initialize sysman for VPU devices only + ZES_INIT_FLAG_NO_DEVICES = ZE_BIT(2), ///< Allows ::zesInit() to succeed when no devices are discovered. Device + ///< discovery is deferred until the first call to ::zesDeviceGet(), in + ///< case no devices can be discovered when ::zesInit() is called. ZES_INIT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_INIT_FLAG_* ENUMs } zes_init_flag_t; @@ -656,13 +665,13 @@ typedef enum _zes_init_flag_t /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x1 < flags` +/// + `0x7 < flags` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY ZE_APIEXPORT ze_result_t ZE_APICALL zesInit( - zes_init_flags_t flags ///< [in] initialization flags. - ///< currently unused, must be 0 (default). + zes_init_flags_t flags ///< [in] initialization flags. This should be 0 or a combination of + ///< ::zes_init_flags_t values. ); /////////////////////////////////////////////////////////////////////////////// @@ -5254,7 +5263,10 @@ typedef enum _zes_mem_health_t } zes_mem_health_t; /////////////////////////////////////////////////////////////////////////////// -/// @brief Memory properties +/// @brief Memory properties. To get the memory vendor ID and memory vendor name, +/// pNext member of this structure should point to an instance of +/// ::zes_memory_vendor_info_ext_properties_t with its stype set to +/// ::ZES_STRUCTURE_TYPE_MEMORY_VENDOR_INFO_EXT_PROPERTIES. typedef struct _zes_mem_properties_t { zes_structure_type_t stype; ///< [in] type of this structure @@ -6111,6 +6123,10 @@ zesPowerSetEnergyThreshold( /// - The implementation of this function should be lock-free. /// - This function returns the different power usage values associated with /// the power domain. +/// - Computing the average power usage may cause this API to wait and +/// return only after the average power is computed over an interval. +/// Applications that do not need it should pass `nullptr` for +/// `pAveragePower` to reduce the time taken by this function. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -6119,9 +6135,7 @@ zesPowerSetEnergyThreshold( /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY /// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE /// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE -/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS /// - ::ZE_RESULT_ERROR_NOT_AVAILABLE /// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE @@ -6129,13 +6143,18 @@ zesPowerSetEnergyThreshold( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hPower` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pInstantPower` -/// + `nullptr == pAveragePower` +/// + `(nullptr == pInstantPower) && (nullptr == pAveragePower)` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + The requested power usage value is not supported on this power domain. +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// + User does not have permissions to request this feature. ZE_APIEXPORT ze_result_t ZE_APICALL zesPowerGetUsage( zes_pwr_handle_t hPower, ///< [in] Handle of the power domain. - uint32_t* pInstantPower, ///< [out] Returns the instant power usage in milliwatts. - uint32_t* pAveragePower ///< [out] Returns the average power usage in milliwatts. + uint32_t* pInstantPower, ///< [out][optional] Returns the instant power usage in milliwatts. If this + ///< is `nullptr`, the instant power usage will not be returned. + uint32_t* pAveragePower ///< [out][optional] Returns the average power usage in milliwatts. If this + ///< is `nullptr`, the average power usage will not be returned. ); #if !defined(__GNUC__) @@ -7220,6 +7239,8 @@ typedef enum _zes_temp_sensors_t ZES_TEMP_SENSORS_GPU_BOARD = 6, ///< The maximum temperature across all sensors in the GPU Board ZES_TEMP_SENSORS_GPU_BOARD_MIN = 7, ///< The minimum temperature across all sensors in the GPU Board ZES_TEMP_SENSORS_VOLTAGE_REGULATOR = 8, ///< The maximum temperature across all sensors in the Voltage Regulator + ZES_TEMP_SENSORS_COMPOSITE = 9, ///< The normalized temperature across the SOC, Memory and Voltage + ///< Regulators at which shutdown will occur ZES_TEMP_SENSORS_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_TEMP_SENSORS_* ENUMs } zes_temp_sensors_t; @@ -9158,6 +9179,8 @@ typedef enum _zes_device_state_ext_flag_t ZES_DEVICE_STATE_EXT_FLAG_WEDGED = ZE_BIT(1), ///< The device is wedged ZES_DEVICE_STATE_EXT_FLAG_SURVIVABILITY = ZE_BIT(2), ///< The device is in survivability mode ZES_DEVICE_STATE_EXT_FLAG_FLASH_OVERRIDE = ZE_BIT(3), ///< The device has flash override enabled + ZES_DEVICE_STATE_EXT_FLAG_GPU_LOST = ZE_BIT(4), ///< The GPU has fallen off the pci bus or is otherwise inaccessible + ZES_DEVICE_STATE_EXT_FLAG_DRIVER_NOT_LOADED = ZE_BIT(5), ///< No kernel driver is bound to the device ZES_DEVICE_STATE_EXT_FLAG_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_DEVICE_STATE_EXT_FLAG_* ENUMs } zes_device_state_ext_flag_t; @@ -9169,7 +9192,8 @@ typedef enum _zes_device_state_ext_flag_t /// - This structure may be returned from ::zesDeviceGetState via the /// `pNext` member of ::zes_device_state_t /// - Provides extended device state information including wedged state, -/// survivability mode, and flash override status +/// survivability mode, flash override status, GPU lost condition, and +/// kernel driver binding status typedef struct _zes_device_ext_state_t { zes_structure_type_t stype; ///< [in] type of this structure @@ -9226,6 +9250,171 @@ typedef struct _zes_oem_serial_id_ext_properties_t } zes_oem_serial_id_ext_properties_t; +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Sysman Extension APIs for Device Health Status +#if !defined(__GNUC__) +#pragma region deviceHealth +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZES_DEVICE_HEALTH_EXT_NAME +/// @brief Device Health Extension Name +#define ZES_DEVICE_HEALTH_EXT_NAME "ZES_extension_device_health" +#endif // ZES_DEVICE_HEALTH_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device Health Extension Version(s) +typedef enum _zes_device_health_ext_version_t +{ + ZES_DEVICE_HEALTH_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZES_DEVICE_HEALTH_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZES_DEVICE_HEALTH_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_DEVICE_HEALTH_EXT_VERSION_* ENUMs + +} zes_device_health_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Device health status +/// +/// @details +/// - Device health represents a comprehensive assessment of a device's +/// reliability and expected performance in upcoming operations. +/// - The health indicator is stored in non-volatile memory (NVM) and +/// persists across resets and firmware updates. +typedef enum _zes_device_health_status_ext_t +{ + ZES_DEVICE_HEALTH_STATUS_EXT_OK = 0, ///< Device is healthy with no known issues + ZES_DEVICE_HEALTH_STATUS_EXT_WARNING = 1, ///< Device may have issues, diagnostics recommended + ZES_DEVICE_HEALTH_STATUS_EXT_CRITICAL = 2, ///< Device should not be used until maintenance is performed + ZES_DEVICE_HEALTH_STATUS_EXT_FAILED = 3, ///< Permanent non-recoverable failure; FRU replacement required + ZES_DEVICE_HEALTH_STATUS_EXT_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_DEVICE_HEALTH_STATUS_EXT_* ENUMs + +} zes_device_health_status_ext_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Get device health status +/// +/// @details +/// - This function retrieves the current health status of the device. +/// - The health status is stored in non-volatile memory and persists across +/// resets and updates. +/// - The health indicator serves purely as telemetry without downstream +/// functional effects. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pHealth` +ZE_APIEXPORT ze_result_t ZE_APICALL +zesDeviceGetHealthStatusExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_health_status_ext_t* pHealth ///< [out] Current health status of the device. + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Set device health status +/// +/// @details +/// - This function sets the health status of the device. +/// - The health status is persisted to non-volatile memory. +/// - Setting health status requires appropriate permissions. +/// - The application should not call this function from simultaneous +/// threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZES_DEVICE_HEALTH_STATUS_EXT_FAILED < health` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// + User does not have permissions to set health status. +ZE_APIEXPORT ze_result_t ZE_APICALL +zesDeviceSetHealthStatusExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_health_status_ext_t health ///< [in] New health status to be set for the device. + ); + +#if !defined(__GNUC__) +#pragma endregion +#endif +// Intel 'oneAPI' Level-Zero Sysman Extension APIs for Memory Vendor Info +#if !defined(__GNUC__) +#pragma region memoryVendorInfo +#endif +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZES_MEMORY_VENDOR_INFO_EXT_NAME +/// @brief Memory Vendor Info Extension Name +#define ZES_MEMORY_VENDOR_INFO_EXT_NAME "ZES_extension_memory_vendor_info" +#endif // ZES_MEMORY_VENDOR_INFO_EXT_NAME + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Memory Vendor Info Extension Version(s) +typedef enum _zes_memory_vendor_info_ext_version_t +{ + ZES_MEMORY_VENDOR_INFO_EXT_VERSION_1_0 = ZE_MAKE_VERSION( 1, 0 ), ///< version 1.0 + ZES_MEMORY_VENDOR_INFO_EXT_VERSION_CURRENT = ZE_MAKE_VERSION( 1, 0 ), ///< latest known version + ZES_MEMORY_VENDOR_INFO_EXT_VERSION_FORCE_UINT32 = 0x7fffffff ///< Value marking end of ZES_MEMORY_VENDOR_INFO_EXT_VERSION_* ENUMs + +} zes_memory_vendor_info_ext_version_t; + +/////////////////////////////////////////////////////////////////////////////// +#ifndef ZES_MEMORY_VENDOR_NAME_EXT_SIZE +/// @brief Maximum memory vendor name string size +#define ZES_MEMORY_VENDOR_NAME_EXT_SIZE 256 +#endif // ZES_MEMORY_VENDOR_NAME_EXT_SIZE + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Memory Vendor Info Extension Properties structure +/// +/// @details +/// - This structure can be passed as an extension structure to +/// ::zesMemoryGetProperties via pNext member +/// - Returns the memory vendor ID and the memory vendor name +typedef struct _zes_memory_vendor_info_ext_properties_t +{ + zes_structure_type_t stype; ///< [in] type of this structure + void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific + ///< structure (i.e. contains stype and pNext). + uint32_t vendorId; ///< [out] Memory vendor ID for the device. A value of 0 indicates that the + ///< memory vendor ID could not be determined. + uint16_t length; ///< [out] Length of the memory vendor name, excluding the null terminator. + ///< A value of 0 indicates that the memory vendor name could not be + ///< determined. + char vendorName[ZES_MEMORY_VENDOR_NAME_EXT_SIZE]; ///< [out] Memory vendor name for the device (NULL terminated string + ///< value). + +} zes_memory_vendor_info_ext_properties_t; + #if !defined(__GNUC__) #pragma endregion #endif diff --git a/include/zes_ddi.h b/include/zes_ddi.h index 513ffa74..ce40eaf0 100644 --- a/include/zes_ddi.h +++ b/include/zes_ddi.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT * * @file zes_ddi.h - * @version v1.17-r1.17.24 + * @version v1.18-r1.18.31 * */ #ifndef _ZES_DDI_H @@ -345,6 +345,20 @@ typedef ze_result_t (ZE_APICALL *zes_pfnDevicePciLinkSpeedUpdateExt_t)( zes_device_action_t* ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zesDeviceGetHealthStatusExt +typedef ze_result_t (ZE_APICALL *zes_pfnDeviceGetHealthStatusExt_t)( + zes_device_handle_t, + zes_device_health_status_ext_t* + ); + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for zesDeviceSetHealthStatusExt +typedef ze_result_t (ZE_APICALL *zes_pfnDeviceSetHealthStatusExt_t)( + zes_device_handle_t, + zes_device_health_status_ext_t + ); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of Device functions pointers typedef struct _zes_device_dditable_t @@ -387,6 +401,8 @@ typedef struct _zes_device_dditable_t zes_pfnDeviceEnumOverclockDomains_t pfnEnumOverclockDomains; zes_pfnDeviceResetExt_t pfnResetExt; zes_pfnDevicePciLinkSpeedUpdateExt_t pfnPciLinkSpeedUpdateExt; + zes_pfnDeviceGetHealthStatusExt_t pfnGetHealthStatusExt; + zes_pfnDeviceSetHealthStatusExt_t pfnSetHealthStatusExt; } zes_device_dditable_t; /////////////////////////////////////////////////////////////////////////////// diff --git a/include/zet.py b/include/zet.py index 4f965a41..2012ede1 100644 --- a/include/zet.py +++ b/include/zet.py @@ -4,7 +4,7 @@ SPDX-License-Identifier: MIT @file zet.py - @version v1.17-r1.17.24 + @version v1.18-r1.18.31 """ import platform @@ -972,13 +972,32 @@ class zet_metric_group_type_exp_t(Structure): ############################################################################### ## @brief Exported dma_buf properties queried using `pNext` of ## ::zet_metric_group_properties_t or ::zet_metric_properties_t +## +## @details +## - This structure must be passed via the `pNext` member of +## ::zet_metric_group_properties_t or ::zet_metric_properties_t +## - The implementation retains ownership of `fd` for its entire lifetime. +## The application must not close `fd`; it is closed by the +## implementation when the metric or metric group that exported it is +## destroyed, or when metrics are disabled on the device. +## - The application must free any allocation it imported from `fd` before +## destroying the exporting metric or metric group, or disabling metrics +## on the device. Otherwise the imported allocation outlives `fd` and any +## subsequent use of it is undefined. +## - `fd` refers to a shared resource. The same `fd` may be reported by +## repeated queries and by queries on different metric or metric group +## handles. The implementation performs no synchronization on `fd` or on +## the memory it exports; if the application uses either from more than +## one thread it must serialize that access itself, for example with a +## mutex or by confining access to a single thread. class zet_export_dma_buf_exp_properties_t(Structure): _fields_ = [ ("stype", zet_structure_type_t), ## [in] type of this structure ("pNext", c_void_p), ## [in,out][optional] must be null or a pointer to an extension-specific ## structure (i.e. contains stype and pNext). - ("fd", c_int), ## [out] the file descriptor handle that could be used to import the - ## memory by the host process. + ("fd", c_int), ## [out] the file descriptor handle provided for importing memory by the + ## host process. + ## Owned by the implementation; must not be closed by the application. ("size", c_size_t) ## [out] size in bytes of the dma_buf ] diff --git a/include/zet_api.h b/include/zet_api.h index 2bf8cdff..9a204843 100644 --- a/include/zet_api.h +++ b/include/zet_api.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT * * @file zet_api.h - * @version v1.17-r1.17.24 + * @version v1.18-r1.18.31 * */ #ifndef _ZET_API_H @@ -3810,13 +3810,32 @@ typedef struct _zet_metric_group_type_exp_t /////////////////////////////////////////////////////////////////////////////// /// @brief Exported dma_buf properties queried using `pNext` of /// ::zet_metric_group_properties_t or ::zet_metric_properties_t +/// +/// @details +/// - This structure must be passed via the `pNext` member of +/// ::zet_metric_group_properties_t or ::zet_metric_properties_t +/// - The implementation retains ownership of `fd` for its entire lifetime. +/// The application must not close `fd`; it is closed by the +/// implementation when the metric or metric group that exported it is +/// destroyed, or when metrics are disabled on the device. +/// - The application must free any allocation it imported from `fd` before +/// destroying the exporting metric or metric group, or disabling metrics +/// on the device. Otherwise the imported allocation outlives `fd` and any +/// subsequent use of it is undefined. +/// - `fd` refers to a shared resource. The same `fd` may be reported by +/// repeated queries and by queries on different metric or metric group +/// handles. The implementation performs no synchronization on `fd` or on +/// the memory it exports; if the application uses either from more than +/// one thread it must serialize that access itself, for example with a +/// mutex or by confining access to a single thread. typedef struct _zet_export_dma_buf_exp_properties_t { zet_structure_type_t stype; ///< [in] type of this structure void* pNext; ///< [in,out][optional] must be null or a pointer to an extension-specific ///< structure (i.e. contains stype and pNext). - int fd; ///< [out] the file descriptor handle that could be used to import the - ///< memory by the host process. + int fd; ///< [out] the file descriptor handle provided for importing memory by the + ///< host process. + ///< Owned by the implementation; must not be closed by the application. size_t size; ///< [out] size in bytes of the dma_buf } zet_export_dma_buf_exp_properties_t; diff --git a/include/zet_ddi.h b/include/zet_ddi.h index 9983d75c..856ead5f 100644 --- a/include/zet_ddi.h +++ b/include/zet_ddi.h @@ -5,7 +5,7 @@ * SPDX-License-Identifier: MIT * * @file zet_ddi.h - * @version v1.17-r1.17.24 + * @version v1.18-r1.18.31 * */ #ifndef _ZET_DDI_H diff --git a/scripts/spec_metadata/input.json b/scripts/spec_metadata/input.json index 705d19aa..b846af7e 100644 --- a/scripts/spec_metadata/input.json +++ b/scripts/spec_metadata/input.json @@ -97,6 +97,7 @@ "$s_pci_link_qual_issue_flags_t", "$s_pci_link_stab_issue_flags_t", "$s_pci_bar_type_t", + "$s_device_health_status_ext_t", "$s_device_state_ext_flags_t", "$s_device_ecc_state_t", "$s_device_action_t", @@ -120,6 +121,8 @@ "PciGetState", "PciGetBars", "PciGetStats", + "GetHealthStatusExt", + "SetHealthStatusExt", "EnumDiagnosticTestSuites", "EccAvailable", "EccConfigurable", @@ -441,7 +444,8 @@ "$s_mem_state_t", "$s_mem_bandwidth_t", "$s_mem_ext_bandwidth_t", - "$s_mem_bandwidth_counter_bits_exp_properties_t" + "$s_mem_bandwidth_counter_bits_exp_properties_t", + "$s_memory_vendor_info_ext_properties_t" ] }, "$sOverclock": { @@ -1050,7 +1054,8 @@ ], "ordinal": 0, "struct": [ - "$x_init_driver_type_desc_t" + "$x_init_driver_type_desc_t", + "$x_init_driver_app_version_ext_desc_t" ] }, "$xCommandList": { @@ -1096,7 +1101,9 @@ "AppendMemoryPrefetch", "AppendMemAdvise", "AppendSignalEvent", + "AppendSignalEventWithParameters", "AppendWaitOnEvents", + "AppendWaitOnEventsWithParameters", "AppendEventReset", "AppendQueryKernelTimestamps", "AppendSignalExternalSemaphoreExt", @@ -1169,7 +1176,8 @@ "GetIndex", "GetFlags", "GetMode", - "GetPriority" + "GetPriority", + "SetPriorityExt" ], "handle": [ "$x_command_queue_handle_t" @@ -1195,6 +1203,7 @@ ], "enum": [ "$x_context_flags_t", + "$x_power_saving_hint_ext_type_t", "$x_power_saving_hint_type_t", "$x_device_raytracing_ext_flags_t", "$x_raytracing_mem_alloc_ext_flags_t" @@ -1228,6 +1237,7 @@ ], "struct": [ "$x_context_desc_t", + "$x_context_power_saving_hint_ext_desc_t", "$x_context_power_saving_hint_exp_desc_t", "$x_device_raytracing_ext_properties_t", "$x_raytracing_mem_alloc_ext_desc_t" @@ -1266,6 +1276,7 @@ "PciGetPropertiesExt", "ReserveCacheExt", "SetCacheAdviceExt", + "GetCompilerInfo", "Get", "GetRootDevice", "GetSubDevices", @@ -1322,6 +1333,7 @@ "$x_pitched_alloc_2dimage_linear_pitch_exp_info_t", "$x_custom_pitch_exp_desc_t", "$x_cache_reservation_ext_desc_t", + "$x_compiler_name_version_t", "$x_device_properties_t", "$x_device_thread_t", "$x_device_compute_properties_t", @@ -1345,6 +1357,7 @@ "$x_float_atomic_ext_properties_t", "$x_scheduling_hint_exp_properties_t", "$x_device_memory_ext_properties_t", + "$x_device_npu_properties_ext_t", "$x_device_readonly_memory_ext_properties_t" ] }, @@ -1582,7 +1595,10 @@ "InstantiateExt", "IsEmptyExt", "DumpContentsExt", - "DestroyExt" + "DestroyExt", + "PauseCaptureExt", + "ResumeCaptureExt", + "GetIdExt" ], "handle": [ "$x_graph_handle_t" @@ -1667,7 +1683,8 @@ "GetSourceAttributes", "SetCacheConfig", "GetProperties", - "GetName" + "GetName", + "GetModuleHandle" ], "handle": [ "$x_kernel_handle_t" @@ -1725,6 +1742,7 @@ "struct": [ "$x_external_memmap_sysmem_ext_desc_t", "$x_ipc_mem_handle_type_ext_desc_t", + "$x_ipc_phys_mem_handle_range_ext_desc_t", "$x_device_mem_alloc_desc_t", "$x_host_mem_alloc_desc_t", "$x_memory_allocation_properties_t", @@ -1759,6 +1777,7 @@ "GetGlobalPointer", "GetKernelNames", "GetProperties", + "GetDeviceHandle", "GetFunctionPointer" ], "handle": [ @@ -2096,6 +2115,24 @@ ], "max": "$S_DEVICE_EXT_STATE_VERSION_CURRENT" }, + "$s_device_health_ext_version_t": { + "class": "", + "etors": [ + "$S_DEVICE_HEALTH_EXT_VERSION_1_0", + "$S_DEVICE_HEALTH_EXT_VERSION_CURRENT" + ], + "max": "$S_DEVICE_HEALTH_EXT_VERSION_CURRENT" + }, + "$s_device_health_status_ext_t": { + "class": "$sDevice", + "etors": [ + "$S_DEVICE_HEALTH_STATUS_EXT_OK", + "$S_DEVICE_HEALTH_STATUS_EXT_WARNING", + "$S_DEVICE_HEALTH_STATUS_EXT_CRITICAL", + "$S_DEVICE_HEALTH_STATUS_EXT_FAILED" + ], + "max": "$S_DEVICE_HEALTH_STATUS_EXT_FAILED" + }, "$s_device_property_flags_t": { "class": "$sDevice", "etors": [ @@ -2112,9 +2149,11 @@ "$S_DEVICE_STATE_EXT_FLAG_NORMAL", "$S_DEVICE_STATE_EXT_FLAG_WEDGED", "$S_DEVICE_STATE_EXT_FLAG_SURVIVABILITY", - "$S_DEVICE_STATE_EXT_FLAG_FLASH_OVERRIDE" + "$S_DEVICE_STATE_EXT_FLAG_FLASH_OVERRIDE", + "$S_DEVICE_STATE_EXT_FLAG_GPU_LOST", + "$S_DEVICE_STATE_EXT_FLAG_DRIVER_NOT_LOADED" ], - "max": "0xf" + "max": "0x3f" }, "$s_device_type_t": { "class": "$sDevice", @@ -2281,9 +2320,11 @@ "$s_init_flags_t": { "class": "$s", "etors": [ - "$S_INIT_FLAG_PLACEHOLDER" + "$S_INIT_FLAG_GPU_ONLY", + "$S_INIT_FLAG_VPU_ONLY", + "$S_INIT_FLAG_NO_DEVICES" ], - "max": "0x1" + "max": "0x7" }, "$s_limit_unit_t": { "class": "$sPower", @@ -2363,6 +2404,14 @@ ], "max": "$S_MEM_TYPE_LPDDR6" }, + "$s_memory_vendor_info_ext_version_t": { + "class": "", + "etors": [ + "$S_MEMORY_VENDOR_INFO_EXT_VERSION_1_0", + "$S_MEMORY_VENDOR_INFO_EXT_VERSION_CURRENT" + ], + "max": "$S_MEMORY_VENDOR_INFO_EXT_VERSION_CURRENT" + }, "$s_oc_mode_t": { "class": "$sFrequency", "etors": [ @@ -2701,9 +2750,10 @@ "$S_STRUCTURE_TYPE_RAS_STATE_EXP2", "$S_STRUCTURE_TYPE_RAS_CONFIG_EXP", "$S_STRUCTURE_TYPE_OEM_SERIAL_ID_EXT_PROPERTIES", - "$S_STRUCTURE_TYPE_DEVICE_EXT_STATE" + "$S_STRUCTURE_TYPE_DEVICE_EXT_STATE", + "$S_STRUCTURE_TYPE_MEMORY_VENDOR_INFO_EXT_PROPERTIES" ], - "max": "$S_STRUCTURE_TYPE_DEVICE_EXT_STATE" + "max": "$S_STRUCTURE_TYPE_MEMORY_VENDOR_INFO_EXT_PROPERTIES" }, "$s_sysman_device_mapping_exp_version_t": { "class": "", @@ -2724,9 +2774,10 @@ "$S_TEMP_SENSORS_MEMORY_MIN", "$S_TEMP_SENSORS_GPU_BOARD", "$S_TEMP_SENSORS_GPU_BOARD_MIN", - "$S_TEMP_SENSORS_VOLTAGE_REGULATOR" + "$S_TEMP_SENSORS_VOLTAGE_REGULATOR", + "$S_TEMP_SENSORS_COMPOSITE" ], - "max": "$S_TEMP_SENSORS_VOLTAGE_REGULATOR" + "max": "$S_TEMP_SENSORS_COMPOSITE" }, "$s_vf_array_type_t": { "class": "$sOverclock", @@ -3077,6 +3128,7 @@ "$X_API_VERSION_1_15", "$X_API_VERSION_1_16", "$X_API_VERSION_1_17", + "$X_API_VERSION_1_18", "$X_API_VERSION_CURRENT" ], "max": "$X_API_VERSION_CURRENT" @@ -3207,6 +3259,14 @@ ], "max": "$X_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH" }, + "$x_command_queue_set_priority_ext_version_t": { + "class": "", + "etors": [ + "$X_COMMAND_QUEUE_SET_PRIORITY_EXT_VERSION_1_0", + "$X_COMMAND_QUEUE_SET_PRIORITY_EXT_VERSION_CURRENT" + ], + "max": "$X_COMMAND_QUEUE_SET_PRIORITY_EXT_VERSION_CURRENT" + }, "$x_context_flags_t": { "class": "$xContext", "etors": [ @@ -3229,6 +3289,16 @@ ], "max": "0x1" }, + "$x_device_compiler_info_t": { + "class": "", + "etors": [ + "$X_DEVICE_COMPILER_INFO_SPIRV_CAPABILITIES", + "$X_DEVICE_COMPILER_INFO_SPIRV_EXTENSIONS", + "$X_DEVICE_COMPILER_INFO_COMPILER_OPTIONS", + "$X_DEVICE_COMPILER_INFO_DRIVER_OPTIONS" + ], + "max": "$X_DEVICE_COMPILER_INFO_DRIVER_OPTIONS" + }, "$x_device_compute_dotproduct_properties_ext_version_t": { "class": "", "etors": [ @@ -3393,6 +3463,14 @@ ], "max": "0xf" }, + "$x_device_npu_properties_ext_version_t": { + "class": "", + "etors": [ + "$X_DEVICE_NPU_PROPERTIES_EXT_VERSION_1_0", + "$X_DEVICE_NPU_PROPERTIES_EXT_VERSION_CURRENT" + ], + "max": "$X_DEVICE_NPU_PROPERTIES_EXT_VERSION_CURRENT" + }, "$x_device_output_data_type_flags_t": { "class": "$xDevice", "etors": [ @@ -3505,9 +3583,10 @@ "$X_EVENT_COUNTER_BASED_FLAG_IPC", "$X_EVENT_COUNTER_BASED_FLAG_DEVICE_TIMESTAMP", "$X_EVENT_COUNTER_BASED_FLAG_HOST_TIMESTAMP", - "$X_EVENT_COUNTER_BASED_FLAG_GRAPH_EXTERNAL" + "$X_EVENT_COUNTER_BASED_FLAG_GRAPH_EXTERNAL", + "$X_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL" ], - "max": "0x7f" + "max": "0xff" }, "$x_event_pool_counter_based_exp_flags_t": { "class": "$xEventPool", @@ -3868,6 +3947,14 @@ ], "max": "$X_IMMEDIATE_COMMAND_LIST_APPEND_EXP_VERSION_CURRENT" }, + "$x_init_driver_app_version_ext_version_t": { + "class": "", + "etors": [ + "$X_INIT_DRIVER_APP_VERSION_EXT_VERSION_1_0", + "$X_INIT_DRIVER_APP_VERSION_EXT_VERSION_CURRENT" + ], + "max": "$X_INIT_DRIVER_APP_VERSION_EXT_VERSION_CURRENT" + }, "$x_init_driver_type_flags_t": { "class": "$x", "etors": [ @@ -3908,6 +3995,14 @@ ], "max": "0x3" }, + "$x_ipc_phys_mem_handle_range_ext_version_t": { + "class": "", + "etors": [ + "$X_IPC_PHYS_MEM_HANDLE_RANGE_EXT_VERSION_1_0", + "$X_IPC_PHYS_MEM_HANDLE_RANGE_EXT_VERSION_CURRENT" + ], + "max": "$X_IPC_PHYS_MEM_HANDLE_RANGE_EXT_VERSION_CURRENT" + }, "$x_ipc_property_flags_t": { "class": "$xDriver", "etors": [ @@ -4161,6 +4256,22 @@ ], "max": "$X_POWER_SAVING_HINT_EXP_VERSION_CURRENT" }, + "$x_power_saving_hint_ext_type_t": { + "class": "$xContext", + "etors": [ + "$X_POWER_SAVING_HINT_EXT_TYPE_MIN", + "$X_POWER_SAVING_HINT_EXT_TYPE_MAX" + ], + "max": "$X_POWER_SAVING_HINT_EXT_TYPE_MAX" + }, + "$x_power_saving_hint_ext_version_t": { + "class": "", + "etors": [ + "$X_POWER_SAVING_HINT_EXT_VERSION_1_0", + "$X_POWER_SAVING_HINT_EXT_VERSION_CURRENT" + ], + "max": "$X_POWER_SAVING_HINT_EXT_VERSION_CURRENT" + }, "$x_power_saving_hint_type_t": { "class": "$xContext", "etors": [ @@ -4601,6 +4712,7 @@ "$X_STRUCTURE_TYPE_IMAGE_FORMAT_SUPPORT_EXT_PROPERTIES", "$X_STRUCTURE_TYPE_DEVICE_READONLY_MEMORY_EXT_PROPERTIES", "$X_STRUCTURE_TYPE_RELAXED_ALLOCATION_LIMITS_EXT_DESC", + "$X_STRUCTURE_TYPE_POWER_SAVING_HINT_EXT_DESC", "$X_STRUCTURE_TYPE_RELAXED_ALLOCATION_LIMITS_EXP_DESC", "$X_STRUCTURE_TYPE_MODULE_PROGRAM_EXP_DESC", "$X_STRUCTURE_TYPE_SCHEDULING_HINT_EXP_PROPERTIES", @@ -4666,9 +4778,12 @@ "$X_STRUCTURE_TYPE_RUNTIME_REQUIREMENTS_GRAPH_DESC", "$X_STRUCTURE_TYPE_RUNTIME_REQUIREMENTS_OUTPUT", "$X_STRUCTURE_TYPE_RECORD_REPLAY_GRAPH_EXT_PROPERTIES", - "$X_STRUCTURE_TYPE_RECORD_REPLAY_GRAPH_EXT_DUMP_DESC" + "$X_STRUCTURE_TYPE_RECORD_REPLAY_GRAPH_EXT_DUMP_DESC", + "$X_STRUCTURE_TYPE_DEVICE_NPU_PROPERTIES_EXT", + "$X_STRUCTURE_TYPE_INIT_DRIVER_APP_VERSION_EXT_DESC", + "$X_STRUCTURE_TYPE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_DESC" ], - "max": "$X_STRUCTURE_TYPE_RECORD_REPLAY_GRAPH_EXT_DUMP_DESC" + "max": "$X_STRUCTURE_TYPE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_DESC" }, "$x_sub_allocations_exp_version_t": { "class": "", @@ -5081,6 +5196,17 @@ } ] }, + "$sDeviceGetHealthStatusExt": { + "class": "$sDevice", + "params": [ + { + "type": "$s_device_handle_t" + }, + { + "type": "$s_device_health_status_ext_t*" + } + ] + }, "$sDeviceGetOverclockControls": { "class": "$sDevice", "params": [ @@ -5287,6 +5413,17 @@ } ] }, + "$sDeviceSetHealthStatusExt": { + "class": "$sDevice", + "params": [ + { + "type": "$s_device_handle_t" + }, + { + "type": "$s_device_health_status_ext_t" + } + ] + }, "$sDeviceSetOverclockWaiver": { "class": "$sDevice", "params": [ @@ -8464,6 +8601,20 @@ } ] }, + "$xCommandListAppendSignalEventWithParameters": { + "class": "$xCommandList", + "params": [ + { + "type": "$x_command_list_handle_t" + }, + { + "type": "const void *" + }, + { + "type": "$x_event_handle_t" + } + ] + }, "$xCommandListAppendSignalExternalSemaphoreExt": { "class": "$xCommandList", "params": [ @@ -8530,6 +8681,23 @@ } ] }, + "$xCommandListAppendWaitOnEventsWithParameters": { + "class": "$xCommandList", + "params": [ + { + "type": "$x_command_list_handle_t" + }, + { + "type": "const void *" + }, + { + "type": "uint32_t" + }, + { + "type": "$x_event_handle_t*" + } + ] + }, "$xCommandListAppendWriteGlobalTimestamp": { "class": "$xCommandList", "params": [ @@ -9037,6 +9205,17 @@ } ] }, + "$xCommandQueueSetPriorityExt": { + "class": "$xCommandQueue", + "params": [ + { + "type": "$x_command_queue_handle_t" + }, + { + "type": "$x_command_queue_priority_t" + } + ] + }, "$xCommandQueueSynchronize": { "class": "$xCommandQueue", "params": [ @@ -9238,6 +9417,26 @@ } ] }, + "$xDeviceGetCompilerInfo": { + "class": "$xDevice", + "params": [ + { + "type": "$x_device_handle_t" + }, + { + "type": "$x_device_compiler_info_t" + }, + { + "type": "const void*" + }, + { + "type": "size_t*" + }, + { + "type": "void*" + } + ] + }, "$xDeviceGetComputeProperties": { "class": "$xDevice", "params": [ @@ -10148,6 +10347,17 @@ } ] }, + "$xGraphGetIdExt": { + "class": "$xGraph", + "params": [ + { + "type": "$x_graph_handle_t" + }, + { + "type": "uint64_t*" + } + ] + }, "$xGraphGetPrimaryCommandListExt": { "class": "$xGraph", "params": [ @@ -10181,6 +10391,22 @@ } ] }, + "$xGraphPauseCaptureExt": { + "class": "$xGraph", + "params": [ + { + "type": "$x_graph_handle_t" + } + ] + }, + "$xGraphResumeCaptureExt": { + "class": "$xGraph", + "params": [ + { + "type": "$x_graph_handle_t" + } + ] + }, "$xGraphSetDestructionCallbackExt": { "class": "$xGraph", "params": [ @@ -10396,6 +10622,17 @@ } ] }, + "$xKernelGetModuleHandle": { + "class": "$xKernel", + "params": [ + { + "type": "$x_kernel_handle_t" + }, + { + "type": "$x_module_handle_t*" + } + ] + }, "$xKernelGetName": { "class": "$xKernel", "params": [ @@ -10912,6 +11149,17 @@ } ] }, + "$xModuleGetDeviceHandle": { + "class": "$xModule", + "params": [ + { + "type": "$x_module_handle_t" + }, + { + "type": "$x_device_handle_t*" + } + ] + }, "$xModuleGetFunctionPointer": { "class": "$xModule", "params": [ @@ -11622,6 +11870,12 @@ "\"$S_extension_device_state\"" ] }, + "$S_DEVICE_HEALTH_EXT_NAME": { + "class": "", + "values": [ + "\"$S_extension_device_health\"" + ] + }, "$S_DIAG_FIRST_TEST_INDEX": { "class": "", "values": [ @@ -11688,6 +11942,18 @@ "\"$XS_extension_mem_bandwidth_counter_bits_properties\"" ] }, + "$S_MEMORY_VENDOR_INFO_EXT_NAME": { + "class": "", + "values": [ + "\"$XS_extension_memory_vendor_info\"" + ] + }, + "$S_MEMORY_VENDOR_NAME_EXT_SIZE": { + "class": "", + "values": [ + "256" + ] + }, "$S_MEM_PAGE_OFFLINE_STATE_EXP_NAME": { "class": "", "values": [ @@ -11927,7 +12193,7 @@ "$X_API_VERSION_CURRENT_M": { "class": "", "values": [ - "$X_MAKE_VERSION( 1, 17 )" + "$X_MAKE_VERSION( 1, 18 )" ] }, "$X_BANDWIDTH_PROPERTIES_EXP_NAME": { @@ -11979,12 +12245,24 @@ "\"$X_experimental_command_list_clone\"" ] }, + "$X_COMMAND_QUEUE_SET_PRIORITY_EXT_NAME": { + "class": "", + "values": [ + "\"$X_extension_command_queue_set_priority\"" + ] + }, "$X_CONTEXT_POWER_SAVING_HINT_EXP_NAME": { "class": "", "values": [ "\"$X_experimental_power_saving_hint\"" ] }, + "$X_CONTEXT_POWER_SAVING_HINT_EXT_NAME": { + "class": "", + "values": [ + "\"$X_extension_power_saving_hint\"" + ] + }, "$X_DEVICE_COMPUTE_DOTPRODUCT_PROPERTIES_EXT_NAME": { "class": "", "values": [ @@ -12009,6 +12287,12 @@ "\"$X_extension_device_memory_properties\"" ] }, + "$X_DEVICE_NPU_PROPERTIES_EXT_NAME": { + "class": "", + "values": [ + "\"$X_extension_device_npu_properties\"" + ] + }, "$X_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_NAME": { "class": "", "values": [ @@ -12154,12 +12438,24 @@ "\"$X_experimental_immediate_command_list_append\"" ] }, + "$X_INIT_DRIVER_APP_VERSION_EXT_NAME": { + "class": "", + "values": [ + "\"$X_extension_init_driver_app_version\"" + ] + }, "$X_IPC_MEM_HANDLE_TYPE_EXT_NAME": { "class": "", "values": [ "\"$X_extension_ipc_mem_handle_type\"" ] }, + "$X_IPC_PHYS_MEM_HANDLE_RANGE_EXT_NAME": { + "class": "", + "values": [ + "\"$X_extension_ipc_phys_mem_handle_range\"" + ] + }, "$X_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_NAME": { "class": "", "values": [ @@ -12782,7 +13078,7 @@ "class": "$sFabricPort", "members": [ { - "desc": "[out] Description of link technology. Will be set to the string \"unkown\" if this cannot be determined for this link.", + "desc": "[out] Description of link technology. Will be set to the string \"unknown\" if this cannot be determined for this link.", "init": null, "name": "desc[$S_MAX_FABRIC_LINK_TYPE_SIZE]", "type": "char" @@ -12862,7 +13158,7 @@ "class": "$sFabricPort", "members": [ { - "desc": "[out] Description of port technology. Will be set to the string \"unkown\" if this cannot be determined for this port.", + "desc": "[out] Description of port technology. Will be set to the string \"unknown\" if this cannot be determined for this port.", "init": null, "name": "model[$S_MAX_FABRIC_PORT_MODEL_SIZE]", "type": "char" @@ -13458,13 +13754,36 @@ "type": "uint64_t" }, { - "desc": "[out] The total allocatable memory in bytes (can be less than the `physicalSize` member of $s_mem_properties_t). *DEPRECATED* \n This member can no longer track the allocatable memory reliably. Clients depending on this information can use the \n zeDeviceGetProperties with ze_device_usablemem_size_ext_properties_t extention to get information of the available usable memory.\n", + "desc": "[out] The total allocatable memory in bytes (can be less than the `physicalSize` member of $s_mem_properties_t). *DEPRECATED* \n This member can no longer track the allocatable memory reliably. Clients depending on this information can use the \n zeDeviceGetProperties with ze_device_usablemem_size_ext_properties_t extension to get information of the available usable memory.\n", "init": null, "name": "size", "type": "uint64_t" } ] }, + "$s_memory_vendor_info_ext_properties_t": { + "class": "$sMemory", + "members": [ + { + "desc": "[out] Memory vendor ID for the device. A value of 0 indicates that the memory vendor ID could not be determined.", + "init": null, + "name": "vendorId", + "type": "uint32_t" + }, + { + "desc": "[out] Length of the memory vendor name, excluding the null terminator. A value of 0 indicates that the memory vendor name could not be determined.", + "init": null, + "name": "length", + "type": "uint16_t" + }, + { + "desc": "[out] Memory vendor name for the device (NULL terminated string value).", + "init": null, + "name": "vendorName[$S_MEMORY_VENDOR_NAME_EXT_SIZE]", + "type": "char" + } + ] + }, "$s_oc_capabilities_t": { "class": "$sFrequency", "members": [ @@ -14916,7 +15235,7 @@ "class": "$tMetric", "members": [ { - "desc": "[out] the file descriptor handle that could be used to import the memory by the host process.", + "desc": "[out] the file descriptor handle provided for importing memory by the host process.\nOwned by the implementation; must not be closed by the application.\n", "init": null, "name": "fd", "type": "int" @@ -15524,6 +15843,23 @@ } ] }, + "$x_compiler_name_version_t": { + "class": "$xDevice", + "members": [ + { + "desc": "[out] packed version of the entry", + "init": null, + "name": "version", + "type": "uint32_t" + }, + { + "desc": "[out] null-terminated name", + "init": null, + "name": "name[$X_MAX_EXTENSION_NAME]", + "type": "char" + } + ] + }, "$x_context_desc_t": { "class": "$xContext", "members": [ @@ -15546,6 +15882,17 @@ } ] }, + "$x_context_power_saving_hint_ext_desc_t": { + "class": "$xContext", + "members": [ + { + "desc": "[in] power saving hint (default value = 0). This is value from [0,100] and can use pre-defined settings from $x_power_saving_hint_ext_type_t.\n", + "init": "0", + "name": "hint", + "type": "uint32_t" + } + ] + }, "$x_copy_bandwidth_exp_properties_t": { "class": "$xCommandQueue", "members": [ @@ -15614,7 +15961,7 @@ "type": "size_t" }, { - "desc": "[in] user programmed slice pitch , must be multiple of rowPitch. For 2D image arrary or a slice of a 3D image array - this pitch should be >= rowPitch * image_height . For 1D iamge array >= rowPitch.\n", + "desc": "[in] user programmed slice pitch , must be multiple of rowPitch. For 2D image array or a slice of a 3D image array - this pitch should be >= rowPitch * image_height . For 1D image array >= rowPitch.\n", "init": null, "name": "slicePitch", "type": "size_t" @@ -16068,6 +16415,83 @@ } ] }, + "$x_device_npu_properties_ext_t": { + "class": "$xDevice", + "members": [ + { + "desc": "[out] Total number of NCE tiles enabled on the device. Equivalent to popcount(tileEnableMask). Supersedes the `numSlices` member of $x_device_properties_t for NPU devices.", + "init": null, + "name": "tileCount", + "type": "uint32_t" + }, + { + "desc": "[out] Bitmask of enabled NCE tiles. popcount(tileEnableMask) == tileCount.", + "init": null, + "name": "tileEnableMask", + "type": "uint32_t" + }, + { + "desc": "[out] Total number of SHAVE (VLIW) vector processors across all tiles. Supersedes the `numEUsPerSubslice` member of $x_device_properties_t for NPU devices.", + "init": null, + "name": "totalShaveCount", + "type": "uint32_t" + }, + { + "desc": "[out] Multiply-accumulate (MAC) units per tile at INT8 x INT8 precision (baseline). Throughput at other precisions: 2x for INT8 x INT4, 0.5x for FP16 x FP16, 0.5x for INT16 x INT8, 1x for INT16 x INT4. Supersedes half the `physicalEUSimdWidth` member of $x_device_properties_t for NPU devices.", + "init": null, + "name": "int8x8MacsPerTile", + "type": "uint32_t" + }, + { + "desc": "[out] Total DPU MAC units across the device. Derived as tileCount * int8x8MacsPerTile.", + "init": null, + "name": "totalDpuMacs", + "type": "uint32_t" + }, + { + "desc": "[out] Number of compute engines on the device.", + "init": null, + "name": "numComputeEngines", + "type": "uint32_t" + }, + { + "desc": "[out] Number of copy (DMA) engines on the device.", + "init": null, + "name": "numCopyEngines", + "type": "uint32_t" + }, + { + "desc": "[out] DPU compute clock rate, in Hz. Supersedes the `coreClockRate` member of $x_device_properties_t for NPU devices.", + "init": null, + "name": "dpuClockRateHz", + "type": "uint64_t" + }, + { + "desc": "[out] Device timestamp counter frequency, in Hz. Used to convert raw device tick counts returned by $xDeviceGetGlobalTimestamps and $xCommandListAppendWriteGlobalTimestamp into time durations.", + "init": null, + "name": "timestampFreqHz", + "type": "uint64_t" + }, + { + "desc": "[out] On-chip CMX SRAM size for neural network workloads, in bytes.", + "init": null, + "name": "nnSramSizeBytes", + "type": "uint64_t" + }, + { + "desc": "[out] Version of the NPU compiler bundled with this driver, using $X_MAKE_VERSION. Use $X_MAJOR_VERSION and $X_MINOR_VERSION to extract the major and minor components.", + "init": null, + "name": "compilerVersion", + "type": "uint32_t" + }, + { + "desc": "[out] Maximum OpenVINO opset version supported by the bundled NPU compiler.", + "init": null, + "name": "maxOVOpsetVersionSupported", + "type": "uint32_t" + } + ] + }, "$x_device_p2p_bandwidth_exp_properties_t": { "class": "$xDevice", "members": [ @@ -16317,7 +16741,7 @@ "class": "$xDevice", "members": [ { - "desc": "[out] Returns the available usable memory at the device level. This is typically less than or equal to the available physical memory on the device. It important to note that usable memory size reported is transient in nature and cannot be used to reliably guarentee success of future allocations. The usable memory includes all the memory that the clients can allocate for their use and by L0 Core for its internal allocations.", + "desc": "[out] Returns the available usable memory at the device level. This is typically less than or equal to the available physical memory on the device. It is important to note that usable memory size reported is transient in nature and cannot be used to reliably guarantee success of future allocations. The usable memory includes all the memory that the clients can allocate for their use and by L0 Core for its internal allocations.", "init": null, "name": "currUsableMemSize", "type": "uint64_t" @@ -16546,7 +16970,7 @@ "class": "$xEvent", "members": [ { - "desc": "[in] device address that would be updated with atomic_add upon signaling of this event, must be device USM memory", + "desc": "[in] device address that would be updated with atomic_add upon signaling of this event, must be device USM memory.\nWhen this event is signaled from append operations that execute on more than one device, the driver performs cross-device (peer) atomic updates to this address. Not all devices support cross-device atomic operations; the user must ensure atomics are supported between the involved devices (see $X_DEVICE_P2P_PROPERTY_FLAG_ATOMICS returned by $xDeviceGetP2PProperties, and cross-device capabilities returned by $xDeviceGetMemoryAccessProperties). Using cross-device signaling on devices that do not support cross-device atomics results in undefined behavior.\n", "init": null, "name": "deviceAddress", "type": "uint64_t*" @@ -16722,7 +17146,7 @@ "type": "$x_external_memory_type_flags_t" }, { - "desc": "[out] the exported file descriptor handle representing the allocation.", + "desc": "[out] the exported file descriptor handle representing the allocation.\nOwned by the driver; must not be closed directly by the application.\n", "init": null, "name": "fd", "type": "int" @@ -16857,7 +17281,7 @@ "type": "$x_uuid_t" }, { - "desc": "[out] Description of fabric edge technology. Will be set to the string \"unkown\" if this cannot be determined for this edge", + "desc": "[out] Description of fabric edge technology. Will be set to the string \"unknown\" if this cannot be determined for this edge", "init": null, "name": "model[$X_MAX_FABRIC_EDGE_MODEL_EXP_SIZE]", "type": "char" @@ -17278,6 +17702,17 @@ } ] }, + "$x_init_driver_app_version_ext_desc_t": { + "class": "$x", + "members": [ + { + "desc": "[in] maximum core $OneApi Level-Zero API version supported by the application.", + "init": null, + "name": "apiVersionHint", + "type": "$x_api_version_t" + } + ] + }, "$x_init_driver_type_desc_t": { "class": "$x", "members": [ @@ -17333,6 +17768,17 @@ } ] }, + "$x_ipc_phys_mem_handle_range_ext_desc_t": { + "class": "$xMem", + "members": [ + { + "desc": "[in] size in bytes of the VA range starting at the `ptr` argument of\n$xMemGetIpcHandleWithProperties; must be non-zero. The range\n[ptr, ptr+size) must be fully mapped; see the details for error behavior.\n", + "init": null, + "name": "size", + "type": "size_t" + } + ] + }, "$x_kernel_allocation_exp_properties_t": { "class": "$xKernel", "members": [ @@ -17710,7 +18156,7 @@ "class": "$xCommandList", "members": [ { - "desc": "[in] mutable command flags.\n - must be 0 (default, equivalent to setting all flags bar kernel instruction), or a valid combination of $x_mutable_command_exp_flag_t\n - in order to include kernel instruction mutation, $X_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION must be explictly included\n", + "desc": "[in] mutable command flags.\n - must be 0 (default, equivalent to setting all flags bar kernel instruction), or a valid combination of $x_mutable_command_exp_flag_t\n - in order to include kernel instruction mutation, $X_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION must be explicitly included\n", "init": null, "name": "flags", "type": "$x_mutable_command_exp_flags_t" @@ -18001,7 +18447,7 @@ "class": "$xDevice", "members": [ { - "desc": "[out] Required pitch Aligment in Bytes.", + "desc": "[out] Required pitch Alignment in Bytes.", "init": null, "name": "pitchAlign", "type": "size_t" @@ -21129,10 +21575,16 @@ "value": "ZE_MAKE_VERSION( 1, 17 )", "version": "1.17" }, + { + "desc": "version 1.18", + "name": "ZE_API_VERSION_1_18", + "value": "ZE_MAKE_VERSION( 1, 18 )", + "version": "1.18" + }, { "desc": "latest known version", "name": "ZE_API_VERSION_CURRENT", - "value": "ZE_MAKE_VERSION( 1, 17 )" + "value": "ZE_MAKE_VERSION( 1, 18 )" } ], "name": "ze_api_version_t", @@ -21378,7 +21830,7 @@ "desc": "Supported command queue flags", "etors": [ { - "desc": "command queue should be optimized for submission to a single device engine.\ndriver **must** disable any implicit optimizations for distributing work across multiple engines.\nthis flag should be used when applications want full control over multi-engine submission and scheduling.\nThis flag is **DEPRECATED** as flag ${X}_COMMAND_LIST_FLAG_EXPLICIT_ONLY is **DEPRECATED**.\n", + "desc": "command queue should be optimized for submission to a single device engine.\ndriver **must** disable any implicit optimizations for distributing work across multiple engines.\nthis flag should be used when applications want full control over multi-engine submission and scheduling.\nThis flag is **DEPRECATED** as flag ZE_COMMAND_LIST_FLAG_EXPLICIT_ONLY is **DEPRECATED**.\n", "name": "ZE_COMMAND_QUEUE_FLAG_EXPLICIT_ONLY", "value": "ZE_BIT(0)" }, @@ -21404,12 +21856,12 @@ "desc": "Supported command queue group property flags", "etors": [ { - "desc": "Command queue group supports enqueing compute commands.", + "desc": "Command queue group supports enqueuing compute commands.", "name": "ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE", "value": "ZE_BIT(0)" }, { - "desc": "Command queue group supports enqueing copy commands.", + "desc": "Command queue group supports enqueuing copy commands.", "name": "ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY", "value": "ZE_BIT(1)" }, @@ -21476,6 +21928,24 @@ "type": "enum", "version": "1.0" }, + "ze_command_queue_set_priority_ext_version_t": { + "desc": "Command Queue Set Priority Extension Version(s)", + "etors": [ + { + "desc": "version 1.0", + "name": "ZE_COMMAND_QUEUE_SET_PRIORITY_EXT_VERSION_1_0", + "value": "ZE_MAKE_VERSION( 1, 0 )" + }, + { + "desc": "latest known version", + "name": "ZE_COMMAND_QUEUE_SET_PRIORITY_EXT_VERSION_CURRENT", + "value": "ZE_MAKE_VERSION( 1, 0 )" + } + ], + "name": "ze_command_queue_set_priority_ext_version_t", + "type": "enum", + "version": "1.18" + }, "ze_context_flags_t": { "class": "zeContext", "desc": "Supported context creation flags", @@ -21522,6 +21992,34 @@ "type": "enum", "version": "1.0" }, + "ze_device_compiler_info_t": { + "desc": "Compiler-info list selected by zeDeviceGetCompilerInfo", + "etors": [ + { + "desc": "Supported SPIR-V capabilities, as an array of uint32_t numeric capability identifiers", + "name": "ZE_DEVICE_COMPILER_INFO_SPIRV_CAPABILITIES", + "value": "1" + }, + { + "desc": "Supported SPIR-V extensions, as an array of null-terminated names, each ZE_MAX_EXTENSION_NAME bytes", + "name": "ZE_DEVICE_COMPILER_INFO_SPIRV_EXTENSIONS", + "value": "2" + }, + { + "desc": "Supported compiler options, as a single null-terminated string of space-separated tokens", + "name": "ZE_DEVICE_COMPILER_INFO_COMPILER_OPTIONS", + "value": "3" + }, + { + "desc": "Supported driver options, as a single null-terminated string of space-separated tokens", + "name": "ZE_DEVICE_COMPILER_INFO_DRIVER_OPTIONS", + "value": "4" + } + ], + "name": "ze_device_compiler_info_t", + "type": "enum", + "version": "1.18" + }, "ze_device_compute_dotproduct_properties_ext_version_t": { "desc": "Device Compute Dot product Property Extension Version(s)", "etors": [ @@ -22072,6 +22570,24 @@ "type": "enum", "version": "1.0" }, + "ze_device_npu_properties_ext_version_t": { + "desc": "NPU Device Properties Extension Version(s)", + "etors": [ + { + "desc": "version 1.0", + "name": "ZE_DEVICE_NPU_PROPERTIES_EXT_VERSION_1_0", + "value": "ZE_MAKE_VERSION( 1, 0 )" + }, + { + "desc": "latest known version", + "name": "ZE_DEVICE_NPU_PROPERTIES_EXT_VERSION_CURRENT", + "value": "ZE_MAKE_VERSION( 1, 0 )" + } + ], + "name": "ze_device_npu_properties_ext_version_t", + "type": "enum", + "version": "1.18" + }, "ze_device_output_data_type_flags_t": { "class": "zeDevice", "desc": "Supported device dot product(dp) output data types or accumulator data types flags", @@ -22370,6 +22886,12 @@ "name": "ZE_EVENT_COUNTER_BASED_FLAG_GRAPH_EXTERNAL", "value": "ZE_BIT(6)", "version": "1.17" + }, + { + "desc": "Extends ZE_EVENT_COUNTER_BASED_FLAG_IPC with bi-directional sharing. Event opened in another process observes the latest state and can also be used for signaling.\nMust be combined with ZE_EVENT_COUNTER_BASED_FLAG_IPC\n", + "name": "ZE_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL", + "value": "ZE_BIT(7)", + "version": "1.18" } ], "name": "ze_event_counter_based_flags_t", @@ -23429,6 +23951,24 @@ "type": "enum", "version": "1.9" }, + "ze_init_driver_app_version_ext_version_t": { + "desc": "Init Driver Application Version Extension Version(s)", + "etors": [ + { + "desc": "version 1.0", + "name": "ZE_INIT_DRIVER_APP_VERSION_EXT_VERSION_1_0", + "value": "ZE_MAKE_VERSION( 1, 0 )" + }, + { + "desc": "latest known version", + "name": "ZE_INIT_DRIVER_APP_VERSION_EXT_VERSION_CURRENT", + "value": "ZE_MAKE_VERSION( 1, 0 )" + } + ], + "name": "ze_init_driver_app_version_ext_version_t", + "type": "enum", + "version": "1.18" + }, "ze_init_driver_type_flags_t": { "class": "ze", "desc": "Supported driver initialization type flags", @@ -23534,6 +24074,24 @@ "type": "enum", "version": "1.0" }, + "ze_ipc_phys_mem_handle_range_ext_version_t": { + "desc": "IPC Physical Memory Range Extension Version(s)", + "etors": [ + { + "desc": "version 1.0", + "name": "ZE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_VERSION_1_0", + "value": "ZE_MAKE_VERSION( 1, 0 )" + }, + { + "desc": "latest known version", + "name": "ZE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_VERSION_CURRENT", + "value": "ZE_MAKE_VERSION( 1, 0 )" + } + ], + "name": "ze_ipc_phys_mem_handle_range_ext_version_t", + "type": "enum", + "version": "1.18" + }, "ze_ipc_property_flags_t": { "class": "zeDriver", "desc": "Supported IPC property flags", @@ -24190,7 +24748,7 @@ "version": "1.0" }, "ze_power_saving_hint_exp_version_t": { - "desc": "Power Saving Hint Extension Version(s)", + "desc": "Power Saving Hint Extension Version(s). @deprecated since 1.18: Use ze_context_power_saving_hint_ext_desc_t instead.", "etors": [ { "desc": "version 1.0", @@ -24207,12 +24765,49 @@ "type": "enum", "version": "1.2" }, - "ze_power_saving_hint_type_t": { + "ze_power_saving_hint_ext_type_t": { "class": "zeContext", "desc": "Supported device types", "etors": [ { - "desc": "Minumum power savings. The device will make no attempt to save power while executing work submitted to this context.", + "desc": "Minimum power savings. The device will make no attempt to save power while executing work submitted to this context.", + "name": "ZE_POWER_SAVING_HINT_EXT_TYPE_MIN", + "value": "0" + }, + { + "desc": "Maximum power savings. The device will do everything to bring power to a minimum while executing work submitted to this context.", + "name": "ZE_POWER_SAVING_HINT_EXT_TYPE_MAX", + "value": "100" + } + ], + "name": "ze_power_saving_hint_ext_type_t", + "type": "enum", + "version": "1.18" + }, + "ze_power_saving_hint_ext_version_t": { + "desc": "Power Saving Hint Extension Version(s)", + "etors": [ + { + "desc": "version 1.0", + "name": "ZE_POWER_SAVING_HINT_EXT_VERSION_1_0", + "value": "ZE_MAKE_VERSION( 1, 0 )" + }, + { + "desc": "latest known version", + "name": "ZE_POWER_SAVING_HINT_EXT_VERSION_CURRENT", + "value": "ZE_MAKE_VERSION( 1, 0 )" + } + ], + "name": "ze_power_saving_hint_ext_version_t", + "type": "enum", + "version": "1.18" + }, + "ze_power_saving_hint_type_t": { + "class": "zeContext", + "desc": "Supported device types. @deprecated since 1.18: Use ze_power_saving_hint_ext_type_t instead.", + "etors": [ + { + "desc": "Minimum power savings. The device will make no attempt to save power while executing work submitted to this context.", "name": "ZE_POWER_SAVING_HINT_TYPE_MIN", "value": "0" }, @@ -25674,6 +26269,12 @@ "value": "0x10016", "version": "1.17" }, + { + "desc": "ze_context_power_saving_hint_ext_desc_t", + "name": "ZE_STRUCTURE_TYPE_POWER_SAVING_HINT_EXT_DESC", + "value": "0x10017", + "version": "1.18" + }, { "desc": "ze_relaxed_allocation_limits_exp_desc_t", "name": "ZE_STRUCTURE_TYPE_RELAXED_ALLOCATION_LIMITS_EXP_DESC", @@ -26069,6 +26670,24 @@ "name": "ZE_STRUCTURE_TYPE_RECORD_REPLAY_GRAPH_EXT_DUMP_DESC", "value": "0x00020048", "version": "1.17" + }, + { + "desc": "ze_device_npu_properties_ext_t", + "name": "ZE_STRUCTURE_TYPE_DEVICE_NPU_PROPERTIES_EXT", + "value": "0x00020049", + "version": "1.18" + }, + { + "desc": "ze_init_driver_app_version_ext_desc_t", + "name": "ZE_STRUCTURE_TYPE_INIT_DRIVER_APP_VERSION_EXT_DESC", + "value": "0x0002004A", + "version": "1.18" + }, + { + "desc": "ze_ipc_phys_mem_handle_range_ext_desc_t", + "name": "ZE_STRUCTURE_TYPE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_DESC", + "value": "0x0002004B", + "version": "1.18" } ], "name": "ze_structure_type_t", @@ -26271,6 +26890,62 @@ "type": "enum", "version": "1.17" }, + "zes_device_health_ext_version_t": { + "desc": "Device Health Extension Version(s)", + "etors": [ + { + "desc": "version 1.0", + "name": "ZES_DEVICE_HEALTH_EXT_VERSION_1_0", + "value": "ZE_MAKE_VERSION( 1, 0 )", + "version": "1.18" + }, + { + "desc": "latest known version", + "name": "ZES_DEVICE_HEALTH_EXT_VERSION_CURRENT", + "value": "ZE_MAKE_VERSION( 1, 0 )" + } + ], + "name": "zes_device_health_ext_version_t", + "type": "enum", + "version": "1.18" + }, + "zes_device_health_status_ext_t": { + "class": "zesDevice", + "desc": "Device health status", + "details": [ + "Device health represents a comprehensive assessment of a device's reliability and expected performance in upcoming operations.", + "The health indicator is stored in non-volatile memory (NVM) and persists across resets and firmware updates." + ], + "etors": [ + { + "desc": "Device is healthy with no known issues", + "name": "ZES_DEVICE_HEALTH_STATUS_EXT_OK", + "value": "0", + "version": "1.18" + }, + { + "desc": "Device may have issues, diagnostics recommended", + "name": "ZES_DEVICE_HEALTH_STATUS_EXT_WARNING", + "value": "1", + "version": "1.18" + }, + { + "desc": "Device should not be used until maintenance is performed", + "name": "ZES_DEVICE_HEALTH_STATUS_EXT_CRITICAL", + "value": "2", + "version": "1.18" + }, + { + "desc": "Permanent non-recoverable failure; FRU replacement required", + "name": "ZES_DEVICE_HEALTH_STATUS_EXT_FAILED", + "value": "3", + "version": "1.18" + } + ], + "name": "zes_device_health_status_ext_t", + "type": "enum", + "version": "1.18" + }, "zes_device_property_flags_t": { "class": "zesDevice", "desc": "Supported device property flags", @@ -26323,6 +26998,18 @@ "desc": "The device has flash override enabled", "name": "ZES_DEVICE_STATE_EXT_FLAG_FLASH_OVERRIDE", "value": "ZE_BIT(3)" + }, + { + "desc": "The GPU has fallen off the pci bus or is otherwise inaccessible", + "name": "ZES_DEVICE_STATE_EXT_FLAG_GPU_LOST", + "value": "ZE_BIT(4)", + "version": "1.18" + }, + { + "desc": "No kernel driver is bound to the device", + "name": "ZES_DEVICE_STATE_EXT_FLAG_DRIVER_NOT_LOADED", + "value": "ZE_BIT(5)", + "version": "1.18" } ], "name": "zes_device_state_ext_flags_t", @@ -26854,9 +27541,22 @@ "desc": "Supported sysman initialization flags", "etors": [ { - "desc": "placeholder for future use", - "name": "ZES_INIT_FLAG_PLACEHOLDER", - "value": "ZE_BIT(0)" + "desc": "Initialize sysman for GPU devices only", + "name": "ZES_INIT_FLAG_GPU_ONLY", + "value": "ZE_BIT(0)", + "version": "1.18" + }, + { + "desc": "Initialize sysman for VPU devices only", + "name": "ZES_INIT_FLAG_VPU_ONLY", + "value": "ZE_BIT(1)", + "version": "1.18" + }, + { + "desc": "Allows zesInit() to succeed when no devices are discovered. Device discovery is deferred until the first call to zesDeviceGet(), in case no devices can be discovered when zesInit() is called.", + "name": "ZES_INIT_FLAG_NO_DEVICES", + "value": "ZE_BIT(2)", + "version": "1.18" } ], "name": "zes_init_flags_t", @@ -27132,6 +27832,25 @@ "type": "enum", "version": "1.0" }, + "zes_memory_vendor_info_ext_version_t": { + "desc": "Memory Vendor Info Extension Version(s)", + "etors": [ + { + "desc": "version 1.0", + "name": "ZES_MEMORY_VENDOR_INFO_EXT_VERSION_1_0", + "value": "ZE_MAKE_VERSION( 1, 0 )", + "version": "1.18" + }, + { + "desc": "latest known version", + "name": "ZES_MEMORY_VENDOR_INFO_EXT_VERSION_CURRENT", + "value": "ZE_MAKE_VERSION( 1, 0 )" + } + ], + "name": "zes_memory_vendor_info_ext_version_t", + "type": "enum", + "version": "1.18" + }, "zes_oc_mode_t": { "class": "zesFrequency", "desc": "Overclocking modes", @@ -28292,6 +29011,12 @@ "name": "ZES_STRUCTURE_TYPE_DEVICE_EXT_STATE", "value": "0x00020018", "version": "1.17" + }, + { + "desc": "zes_memory_vendor_info_ext_properties_t", + "name": "ZES_STRUCTURE_TYPE_MEMORY_VENDOR_INFO_EXT_PROPERTIES", + "value": "0x00020019", + "version": "1.18" } ], "name": "zes_structure_type_t", @@ -28367,6 +29092,12 @@ "name": "ZES_TEMP_SENSORS_VOLTAGE_REGULATOR", "value": "8", "version": "1.10" + }, + { + "desc": "The normalized temperature across the SOC, Memory and Voltage Regulators at which shutdown will occur", + "name": "ZES_TEMP_SENSORS_COMPOSITE", + "value": "9", + "version": "1.18" } ], "name": "zes_temp_sensors_t", @@ -28475,7 +29206,7 @@ }, "zes_vf_program_type_t": { "class": "zesOverclock", - "desc": "Overclock V-F curve programing.", + "desc": "Overclock V-F curve programming.", "etors": [ { "desc": "Can program an arbitrary number of V-F points up to the maximum number and each point can have arbitrary voltage and frequency values within the min/max/step limits", @@ -29080,7 +29811,7 @@ }, "zet_profile_flags_t": { "class": "zetKernel", - "desc": "Supportted profile features", + "desc": "Supported profile features", "etors": [ { "desc": "request the compiler attempt to minimize register usage as much as possible to allow for instrumentation", @@ -31493,8 +32224,8 @@ "This function may **not** be called from simultaneous threads with the same command list handle.", "The implementation of this function should be lock-free.", "This function supports both immediate and regular command lists.", - "This function changes kernel state as if separate ${x}KernelSetGroupSize and ${x}KernelSetArgumentValue functions were called.", - "This function allows to pass additional extensions in the form of `${x}_base_desc_t`" + "This function changes kernel state as if separate zeKernelSetGroupSize and zeKernelSetArgumentValue functions were called.", + "This function allows to pass additional extensions in the form of ze_base_desc_t ." ], "hash": "20d3fe433ebf999d27f9524307fe6eb57c72dac9092bf240bad4a2230e325cbb", "name": "AppendLaunchKernelWithArguments", @@ -31604,10 +32335,10 @@ ] }, { - "ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION - \"as per ${x}KernelSetGroupSize\"": [] + "ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION - as per zeKernelSetGroupSize": [] }, { - "ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT - \"as per ${x}KernelSetArgumentValue\"": [] + "ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT - as per zeKernelSetArgumentValue": [] } ], "type": "function", @@ -31622,8 +32353,8 @@ "The application must ensure the command list, kernel and events were created on the same context.", "This function may **not** be called from simultaneous threads with the same command list handle.", "The implementation of this function should be lock-free.", - "This function allows to pass additional parameters in the form of `${x}_base_desc_t`", - "This function can replace zeCommandListAppendLaunchCooperativeKernel with additional parameter `${x}_command_list_append_launch_kernel_param_cooperative_desc_t`", + "This function allows to pass additional parameters in the form of ze_base_desc_t .", + "This function can replace zeCommandListAppendLaunchCooperativeKernel with additional parameter ze_command_list_append_launch_kernel_param_cooperative_desc_t .", "This function supports both immediate and regular command lists." ], "hash": "68de0f134fa51cd128beb83b3126c3eb4076d3530dd023ff9c996d4575b0d761", @@ -31740,7 +32471,7 @@ "The application must ensure the array of launch arguments and count buffer are visible to the device on which the command list was created.", "The implementation must not access the contents of the array of launch arguments or count buffer as they are free to be modified by either the Host or device up until execution.", "This may **only** be called for a command list created with command queue group ordinal that supports compute.", - "The application must enusre the command list, kernel and events were created, and the memory was allocated, on the same context.", + "The application must ensure the command list, kernel and events were created, and the memory was allocated, on the same context.", "This function may **not** be called from simultaneous threads with the same command list handle.", "The implementation of this function should be lock-free." ], @@ -33491,7 +34222,8 @@ "The duration of an event created from an event pool that was created using ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP or ZE_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP flags is undefined. However, for consistency and orthogonality the event will report correctly as signaled when used by other event API functionality.", "The application must ensure the command list and events were created on the same context.", "The application must **not** call this function from simultaneous threads with the same command list handle.", - "The implementation of this function should be lock-free." + "The implementation of this function should be lock-free.", + "Passing additional parameters is possible with zeCommandListAppendSignalEventWithParameters function." ], "hash": "ef0d28011f775d958ceb555be2b1461cc174bf0b645a7086af4617a238d567d1", "name": "AppendSignalEvent", @@ -33562,6 +34294,95 @@ "type": "function", "version": "1.0" }, + "AppendSignalEventWithParameters": { + "class": "zeCommandList", + "desc": "Appends a signal of the event from the device into a command list and allows to pass additional parameters.", + "details": [ + "The application must ensure the events are accessible by the device on which the command list was created. This requirement does not apply to counter-based events.", + "For counter-based events, the event may be signaled on any device, regardless of the device used to create the event. When a counter-based event is passed for signaling, it drops its previous tracking point and re-associates with the device on which the command list was created, tracking the new signaling point. No peer-to-peer access between the previously associated device and the new signaling device is required.", + "The duration of an event created from an event pool that was created using ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP or ZE_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP flags is undefined. However, for consistency and orthogonality the event will report correctly as signaled when used by other event API functionality.", + "The application must ensure the command list and events were created on the same context.", + "The application must **not** call this function from simultaneous threads with the same command list handle.", + "The implementation of this function should be lock-free.", + "This function allows to pass additional parameters in the form of ze_base_desc_t .", + "This function acts like zeCommandListAppendSignalEvent when passing `NULL` value to `pNext`." + ], + "hash": "189cbf9089a5ab76a972096944af8f98e0687a0211e1a01f1c88d02dcd8568f5", + "name": "AppendSignalEventWithParameters", + "params": [ + { + "desc": "[in] handle of the command list", + "name": "hCommandList", + "type": "ze_command_list_handle_t" + }, + { + "desc": "[in][optional] additional parameters passed to the function", + "name": "pNext", + "type": "const void *" + }, + { + "desc": "[in] handle of the event", + "name": "hEvent", + "type": "ze_event_handle_t" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "ZE_RESULT_SUCCESS": [] + }, + { + "ZE_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "ZE_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "ZE_RESULT_ERROR_UNKNOWN": [] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hCommandList`", + "`nullptr == hEvent`" + ] + }, + { + "ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT": [] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [ + "when passed additional parameters are invalid or incompatible with the device or command list" + ] + } + ], + "type": "function", + "version": "1.18" + }, "AppendSignalExternalSemaphoreExt": { "class": "zeCommandList", "desc": "Signal an external semaphore", @@ -33804,7 +34625,8 @@ "For counter-based events, the device on which the command list was created must have peer-to-peer access to the device that last signaled the event. Unlike signaling, waiting on a counter-based event does not re-associate it with another device.", "The application must ensure the command list and events were created on the same context.", "The application must **not** call this function from simultaneous threads with the same command list handle.", - "The implementation of this function should be lock-free." + "The implementation of this function should be lock-free.", + "Passing additional parameters is possible with zeCommandListAppendWaitOnEventsWithParameters function." ], "hash": "ba8886530b42c816643a1fd9bc79e7b1599c5488c322575de5cb14cb4422e611", "name": "AppendWaitOnEvents", @@ -33884,6 +34706,103 @@ "type": "function", "version": "1.0" }, + "AppendWaitOnEventsWithParameters": { + "class": "zeCommandList", + "desc": "Appends wait on event(s) on the device into a command list and allows to pass additional parameters.", + "details": [ + "The application must ensure the events are accessible by the device on which the command list was created.", + "For counter-based events, the device on which the command list was created must have peer-to-peer access to the device that last signaled the event. Unlike signaling, waiting on a counter-based event does not re-associate it with another device.", + "The application must ensure the command list and events were created on the same context.", + "The application must **not** call this function from simultaneous threads with the same command list handle.", + "The implementation of this function should be lock-free.", + "This function allows to pass additional parameters in the form of ze_base_desc_t .", + "This function acts like zeCommandListAppendWaitOnEvents when passing `NULL` value to `pNext`." + ], + "hash": "9cbae570cbf601e01dc036b4e45d4de86a169b753b808e25dd50b9016229bc93", + "name": "AppendWaitOnEventsWithParameters", + "params": [ + { + "desc": "[in] handle of the command list", + "name": "hCommandList", + "type": "ze_command_list_handle_t" + }, + { + "desc": "[in][optional] additional parameters passed to the function", + "name": "pNext", + "type": "const void *" + }, + { + "desc": "[in] number of events to wait on before continuing", + "name": "numEvents", + "type": "uint32_t" + }, + { + "desc": "[in][range(0, numEvents)] handles of the events to wait on before continuing", + "name": "phEvents", + "type": "ze_event_handle_t*" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "ZE_RESULT_SUCCESS": [] + }, + { + "ZE_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "ZE_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "ZE_RESULT_ERROR_UNKNOWN": [] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hCommandList`" + ] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == phEvents`" + ] + }, + { + "ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT": [] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [ + "when passed additional parameters are invalid or incompatible with the device or command list" + ] + } + ], + "type": "function", + "version": "1.18" + }, "AppendWriteGlobalTimestamp": { "class": "zeCommandList", "desc": "Appends a memory write of the device's global timestamp value into a command list.", @@ -34409,7 +35328,7 @@ "When using the \"expected\" size for the acceleration structure buffer, the acceleration structure construction may fail with ZE_RESULT_EXT_RTAS_BUILD_RETRY. If this happens, the user may resize their acceleration structure buffer using the returned `*pRtasBufferSizeBytes` value, which will be updated with an improved size estimate that will likely result in a successful build.\n", "The acceleration structure construction is run on the host and is synchronous, thus after the function returns with a successful result, the acceleration structure may be used.\n", "All provided data buffers must be host-accessible. The referenced scene data (index- and vertex- buffers) have to be accessible from the host, and will **not** be referenced by the build acceleration structure.\n", - "The acceleration structure buffer is typicall a host allocation that is later manually copied to a device allocation. Alternatively one can also use a shared USM allocation as acceration structure buffer and skip the copy.\n", + "The acceleration structure buffer is typically a host allocation that is later manually copied to a device allocation. Alternatively one can also use a shared USM allocation as acceleration structure buffer and skip the copy.\n", "A successfully constructed acceleration structure is entirely self-contained. There is no requirement for input data to persist beyond build completion.\n", "A successfully constructed acceleration structure is non-copyable.\n", "Acceleration structure construction may be parallelized by passing a valid handle to a parallel operation object and joining that parallel operation using zeRTASParallelOperationJoinExt with user-provided worker threads.\n", @@ -35234,6 +36153,8 @@ "desc": "Closes an IPC memory handle", "details": [ "Closes an IPC memory handle by unmapping memory that was opened in this process using zeMemOpenIpcHandle.", + "`ptr` must be the base pointer returned by zeMemOpenIpcHandle; passing an interior address is not valid.", + "This call unmaps every physical memory object that zeMemOpenIpcHandle mapped for this pointer and frees any virtual address reservation the driver created on the caller's behalf to back it. When the handle encoded a range of multiple physical objects, all of those objects are unmapped by this single call. The application never reserved this address range and must not attempt to release it with zeVirtualMemFree; this call leaves no mappings or virtual address reservation behind.", "The application must **not** call this function from simultaneous threads with the same pointer.", "The implementation of this function must be thread-safe." ], @@ -35537,9 +36458,6 @@ { "ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] }, - { - "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [] - }, { "ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] }, @@ -35572,7 +36490,7 @@ }, { "ZE_RESULT_ERROR_INVALID_ENUMERATION": [ - "`0x7f < desc->flags`", + "`0xff < desc->flags`", "`0x7 < desc->signal`", "`0x7 < desc->wait`" ] @@ -35582,7 +36500,13 @@ }, { "ZE_RESULT_ERROR_INVALID_ARGUMENT": [ - "`completionValue` provided in `pNext` ze_event_counter_based_external_sync_allocation_desc_t or ze_event_counter_based_external_aggregate_storage_desc_t exceeds the value returned by zeDeviceGetCounterBasedEventMaxValue" + "`completionValue` provided in `pNext` ze_event_counter_based_external_sync_allocation_desc_t or ze_event_counter_based_external_aggregate_storage_desc_t exceeds the value returned by zeDeviceGetCounterBasedEventMaxValue", + "ZE_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL is set without ZE_EVENT_COUNTER_BASED_FLAG_IPC" + ] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [ + "ZE_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL is set and the implementation does not provide bi-directional IPC sharing" ] } ], @@ -35671,6 +36595,10 @@ "CounterBasedGetIpcHandle": { "class": "zeEvent", "desc": "Gets an IPC counter based event handle that can be shared with another process.", + "details": [ + "When the event was created with ZE_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL, it may be shared before it is enqueued for signaling for the first time, and the returned handle remains valid after the event state is replaced by a signal operation. It does not have to be obtained again.", + "Without that flag, a handle represents the state captured at the time of this call. A new handle must be obtained every time the state is replaced, and this function returns ZE_RESULT_ERROR_INVALID_ARGUMENT for an event that has not been enqueued for signaling yet." + ], "hash": "03b4ce20d67c426b91e040491a199e90134091131860071734f1bfc372c21fc2", "name": "CounterBasedGetIpcHandle", "params": [ @@ -35749,9 +36677,12 @@ "decl": "static", "desc": "Opens an IPC event handle to retrieve from another process.", "details": [ + "IPC sharing is bi-directional when the exported event was created with ZE_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL. The opened event then refers to the same synchronization point as the event in the exporting process and may be used for waiting, querying and signaling. Without that flag the opened event holds the state captured when its handle was obtained, may be used only for waiting and querying, and must be opened again every time the state is replaced in the exporting process.", + "With bi-directional sharing, the opened event remains valid after its state is replaced by a signal operation performed in either process. It does not have to be opened again, and both processes observe the latest state.", + "With bi-directional sharing, the application must keep both processes alive for as long as the opened event is used. Waiting on, querying or signaling the event after the process that produced the latest state has exited results in undefined behavior.", "The `hContext` parameter has no requirement to match the context that was used to create the event in the exporting process. Any context of the importing process may be used, including the driver's default context.", "Device association of the opened event depends on its current state at the time of the call: if the event has not yet been enqueued for signaling, no device is yet associated with it; if the event has been enqueued for signaling, it is associated with the device performing that signal operation.", - "Any device of the importing process may signal the opened event. Enqueuing a signal operation overwrites the previous tracking point.", + "With bi-directional sharing, any device of the importing process may signal the opened event. Enqueuing a signal operation overwrites the previous tracking point.", "A device may wait on the opened event only if it has P2P access to the device associated with the current tracking point. The set of devices that may wait therefore depends on the P2P capabilities relative to the signaling device." ], "hash": "f064aa5ef47d2423b1371dee8b94576cf024861c5a7c886e10abbf6db369da85", @@ -35791,9 +36722,6 @@ { "ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] }, - { - "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [] - }, { "ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] }, @@ -35824,6 +36752,11 @@ }, { "ZE_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [ + "the handle was exported by an event created with ZE_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL and the implementation does not provide bi-directional IPC sharing" + ] } ], "type": "function", @@ -37771,12 +38704,12 @@ ] }, { - "$ZE_RESULT_ERROR_GRAPH_UNJOINED_FORKS": [ + "ZE_RESULT_ERROR_GRAPH_UNJOINED_FORKS": [ "if graph contains unjoined forks" ] }, { - "$ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING": [ + "ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING": [ "if command list is not in graph capture mode" ] } @@ -40021,7 +40954,7 @@ "desc": "Frees allocated host memory, device memory, or shared memory on the context using the specified free policy.", "details": [ "Similar to zeMemFree, with added parameter to choose the free policy.", - "Does not gaurantee memory is freed upon return. See free policy descriptions for details.", + "Does not guarantee memory is freed upon return. See free policy descriptions for details.", "The application must **not** call this function from simultaneous threads with the same pointer.", "The implementation of this function must be thread-safe." ], @@ -41761,6 +42694,113 @@ "type": "function", "version": "1.0" }, + "GetCompilerInfo": { + "class": "zeDevice", + "desc": "Retrieves compiler-specific information for the device, selected by an enumerated type.", + "details": [ + "This query is scoped to compiler-specific data.", + "The paramName parameter selects data to be queried. Data layout is documented along with respective paramName enum entry.", + "The application may call this function from simultaneous threads.", + "The implementation of this function should be lock-free." + ], + "hash": "ac5fc7472ee620cc58c1f186dfb20b1d94b7af0ea9b91766989602e8fabb1633", + "name": "GetCompilerInfo", + "params": [ + { + "desc": "[in] handle of the device", + "name": "hDevice", + "type": "ze_device_handle_t" + }, + { + "desc": "[in] compiler-info to return", + "name": "paramName", + "type": "ze_device_compiler_info_t" + }, + { + "desc": "[in][optional] additional extensions passed to the function", + "init": "nullptr", + "name": "pNext", + "type": "const void*" + }, + { + "desc": "[in,out] pointer to the size in bytes of the result.\nIf size is zero, then the driver shall update the value with the total size in bytes needed.\nIf size is less than the total size needed, then the driver shall update the value with the required size and shall not write to pData.\n", + "init": "nullptr", + "name": "pSize", + "type": "size_t*" + }, + { + "desc": "[in,out][optional][range(0, *pSize)] pointer to the result buffer.\nIf pData is nullptr, then only the required size is returned in pSize.\n", + "init": "nullptr", + "name": "pData", + "type": "void*" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "ZE_RESULT_SUCCESS": [] + }, + { + "ZE_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "ZE_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "ZE_RESULT_ERROR_UNKNOWN": [] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hDevice`" + ] + }, + { + "ZE_RESULT_ERROR_INVALID_ENUMERATION": [ + "`ZE_DEVICE_COMPILER_INFO_DRIVER_OPTIONS < paramName`" + ] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION": [] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == pSize`" + ] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [ + "an extension passed via pNext is not supported" + ] + } + ], + "type": "function", + "version": "1.18" + }, "GetComputeProperties": { "analogue": [ "clGetDeviceInfo" @@ -43324,22 +44364,21 @@ "version": "1.4" }, "GetDeviceHandle": { - "class": "zeCommandList", - "desc": "Gets the handle of the device on which the command list was created.", + "class": "zeModule", + "desc": "Retrieve the handle of the device on which the module was created.", "details": [ - "The application may call this function from simultaneous threads.", - "The implementation of this function should be lock-free." + "The application may call this function from simultaneous threads." ], - "hash": "415fb57c3d440d14edcfc2f819c0096d3782ee45669422a820701781eeae9f87", + "hash": "93e8f9a3ff92becea187ca642fac7ed7042a34034b47a0d8686047caf3e904df", "name": "GetDeviceHandle", "params": [ { - "desc": "[in] handle of the command list", - "name": "hCommandList", - "type": "ze_command_list_handle_t" + "desc": "[in] handle of the module", + "name": "hModule", + "type": "ze_module_handle_t" }, { - "desc": "[out] handle of the device on which the command list was created", + "desc": "[out] handle of the device the module was created for", "name": "phDevice", "type": "ze_device_handle_t*" } @@ -43388,7 +44427,7 @@ }, { "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hCommandList`" + "`nullptr == hModule`" ] }, { @@ -43398,7 +44437,7 @@ } ], "type": "function", - "version": "1.9" + "version": "1.18" }, "GetDeviceOffsetExp": { "class": "zeImage", @@ -45297,7 +46336,7 @@ ] }, { - "$ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING": [ + "ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING": [ "if command list is not in graph capture mode" ] } @@ -45305,27 +46344,28 @@ "type": "function", "version": "1.17" }, - "GetImageProperties": { - "class": "zeDevice", - "desc": "Retrieves image properties of the device", + "GetHealthStatusExt": { + "class": "zesDevice", + "desc": "Get device health status", "details": [ - "See zeImageGetProperties for format-specific capabilities.", + "This function retrieves the current health status of the device.", + "The health status is stored in non-volatile memory and persists across resets and updates.", + "The health indicator serves purely as telemetry without downstream functional effects.", "The application may call this function from simultaneous threads.", "The implementation of this function should be lock-free." ], - "hash": "bde7a513c160408c6c590644da9f96a3e8c341222d50c1f4cb015595727aafa7", - "name": "GetImageProperties", - "ordinal": "1", + "hash": "f7520c8ecea8a10bcdcf8e5326f1b66c0f7085637503505abbc500b19c99679f", + "name": "GetHealthStatusExt", "params": [ { - "desc": "[in] handle of the device", + "desc": "[in] Sysman handle of the device.", "name": "hDevice", - "type": "ze_device_handle_t" + "type": "zes_device_handle_t" }, { - "desc": "[in,out] query result for image properties", - "name": "pImageProperties", - "type": "ze_device_image_properties_t*" + "desc": "[out] Current health status of the device.", + "name": "pHealth", + "type": "zes_device_health_status_ext_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -45377,32 +46417,28 @@ }, { "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == pImageProperties`" + "`nullptr == pHealth`" ] } ], "type": "function", - "version": "1.0" + "version": "1.18" }, - "GetIndex": { - "class": "zeCommandQueue", - "desc": "Gets the command queue index within the group.", - "details": [ - "The application may call this function from simultaneous threads.", - "The implementation of this function should be lock-free." - ], - "hash": "0b83e32e93540fc3317a0ad0d0aed594e1462e9760098d31db597ffb61dfc941", - "name": "GetIndex", + "GetIdExt": { + "class": "zeGraph", + "desc": "Gets monotonically increasing, process-unique ID of the graph.", + "hash": "5dbd9de2403e78eaa6faecfefacdb6b06ede1a944b3bb71847b3df9b56654321", + "name": "GetIdExt", "params": [ { - "desc": "[in] handle of the command queue", - "name": "hCommandQueue", - "type": "ze_command_queue_handle_t" + "desc": "[in] handle to the graph", + "name": "hGraph", + "type": "ze_graph_handle_t" }, { - "desc": "[out] command queue index within the group", - "name": "pIndex", - "type": "uint32_t*" + "desc": "[out] pointer to the memory where the graph ID will be written", + "name": "pGraphId", + "type": "uint64_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -45449,37 +46485,39 @@ }, { "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hCommandQueue`" + "`nullptr == hGraph`" ] }, { "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == pIndex`" + "`nullptr == pGraphId`" ] } ], "type": "function", - "version": "1.9" + "version": "1.18" }, - "GetIndirectAccess": { - "class": "zeKernel", - "desc": "Retrieve kernel indirect access flags.", + "GetImageProperties": { + "class": "zeDevice", + "desc": "Retrieves image properties of the device", "details": [ - "This function may be called from simultaneous threads with the same Kernel handle.", + "See zeImageGetProperties for format-specific capabilities.", + "The application may call this function from simultaneous threads.", "The implementation of this function should be lock-free." ], - "hash": "e95327d9eb9e3e93fa04fcb25411b5f5aa78220c63165ca3f7b0e1d3a8d51771", - "name": "GetIndirectAccess", + "hash": "bde7a513c160408c6c590644da9f96a3e8c341222d50c1f4cb015595727aafa7", + "name": "GetImageProperties", + "ordinal": "1", "params": [ { - "desc": "[in] handle of the kernel object", - "name": "hKernel", - "type": "ze_kernel_handle_t" + "desc": "[in] handle of the device", + "name": "hDevice", + "type": "ze_device_handle_t" }, { - "desc": "[out] query result for kernel indirect access flags.", - "name": "pFlags", - "type": "ze_kernel_indirect_access_flags_t*" + "desc": "[in,out] query result for image properties", + "name": "pImageProperties", + "type": "ze_device_image_properties_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -45526,46 +46564,37 @@ }, { "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hKernel`" + "`nullptr == hDevice`" ] }, { "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == pFlags`" + "`nullptr == pImageProperties`" ] } ], "type": "function", "version": "1.0" }, - "GetIpcHandle": { - "class": "zeMem", - "decl": "static", - "desc": "Creates an IPC memory handle for the specified allocation", + "GetIndex": { + "class": "zeCommandQueue", + "desc": "Gets the command queue index within the group.", "details": [ - "Takes a pointer to a device memory allocation and creates an IPC memory handle for exporting it for use in another process.", - "The pointer may also be a physical memory handle cast to ``void*`` (i.e. ``(void*)hPhysicalMem``); in that case, the IPC handle represents the physical memory object directly and no virtual address mapping is required in the sending process.", - "Only one physical memory object may be associated with a single IPC handle at a time; the virtual address range passed must map to exactly one physical memory object.", "The application may call this function from simultaneous threads.", - "The implementation of this function must be thread-safe." + "The implementation of this function should be lock-free." ], - "hash": "0c93fecc4e19c55c79ca9d1b7001f7c9fcdc783c6cb181c18cae4924ae0e7b4a", - "name": "GetIpcHandle", + "hash": "0b83e32e93540fc3317a0ad0d0aed594e1462e9760098d31db597ffb61dfc941", + "name": "GetIndex", "params": [ { - "desc": "[in] handle of the context object", - "name": "hContext", - "type": "ze_context_handle_t" - }, - { - "desc": "[in] pointer to the device memory allocation", - "name": "ptr", - "type": "const void*" + "desc": "[in] handle of the command queue", + "name": "hCommandQueue", + "type": "ze_command_queue_handle_t" }, { - "desc": "[out] Returned IPC memory handle", - "name": "pIpcHandle", - "type": "ze_ipc_mem_handle_t*" + "desc": "[out] command queue index within the group", + "name": "pIndex", + "type": "uint32_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -45612,46 +46641,37 @@ }, { "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hContext`" + "`nullptr == hCommandQueue`" ] }, { "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == ptr`", - "`nullptr == pIpcHandle`" + "`nullptr == pIndex`" ] } ], "type": "function", - "version": "1.0" + "version": "1.9" }, - "GetIpcHandleFromFileDescriptorExp": { - "class": "zeMem", - "decl": "static", - "desc": "Creates an IPC memory handle out of a file descriptor", + "GetIndirectAccess": { + "class": "zeKernel", + "desc": "Retrieve kernel indirect access flags.", "details": [ - "Handle passed must be a valid file descriptor obtained with ze_external_memory_export_fd_t via zeMemGetAllocProperties or zePhysicalMemGetProperties.", - "Returned IPC handle may contain metadata in addition to the file descriptor.", - "The application may call this function from simultaneous threads.", - "The implementation of this function must be thread-safe." + "This function may be called from simultaneous threads with the same Kernel handle.", + "The implementation of this function should be lock-free." ], - "hash": "85dd8fd011ef561b945d46995f774fa76385cef8b350475fb4fa35684277399e", - "name": "GetIpcHandleFromFileDescriptorExp", + "hash": "e95327d9eb9e3e93fa04fcb25411b5f5aa78220c63165ca3f7b0e1d3a8d51771", + "name": "GetIndirectAccess", "params": [ { - "desc": "[in] handle of the context object", - "name": "hContext", - "type": "ze_context_handle_t" - }, - { - "desc": "[in] file descriptor", - "name": "handle", - "type": "uint64_t" + "desc": "[in] handle of the kernel object", + "name": "hKernel", + "type": "ze_kernel_handle_t" }, { - "desc": "[out] Returned IPC memory handle", - "name": "pIpcHandle", - "type": "ze_ipc_mem_handle_t*" + "desc": "[out] query result for kernel indirect access flags.", + "name": "pFlags", + "type": "ze_kernel_indirect_access_flags_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -45698,32 +46718,31 @@ }, { "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hContext`" + "`nullptr == hKernel`" ] }, { "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == pIpcHandle`" + "`nullptr == pFlags`" ] } ], "type": "function", - "version": "1.6" + "version": "1.0" }, - "GetIpcHandleWithProperties": { + "GetIpcHandle": { "class": "zeMem", "decl": "static", - "desc": "Creates an IPC memory handle for the specified allocation with properties for the requested handle.", + "desc": "Creates an IPC memory handle for the specified allocation", "details": [ - "Takes a pointer to a device or host memory allocation and creates an IPC memory handle for exporting it for use in another process.", - "The pointer must be the base pointer of a device or host memory allocation; i.e. the value returned from zeMemAllocDevice or from zeMemAllocHost, respectively or allocated from zePhysicalMemCreate.", - "The pointer may also be a virtual address that was mapped to a physical memory object via zeVirtualMemMap; in that case, the IPC handle represents the underlying physical memory object.", - "Only one physical memory object may be associated with a single IPC handle at a time; the virtual address range passed must map to exactly one physical memory object.", + "Takes a pointer to a device memory allocation and creates an IPC memory handle for exporting it for use in another process.", + "The pointer may also be a physical memory handle cast to ``void*`` (i.e. ``(void*)hPhysicalMem``); in that case, the IPC handle represents the physical memory object directly and no virtual address mapping is required in the sending process.", + "Only one physical memory object may be associated with a single IPC handle at a time; the virtual address range passed must map to exactly one physical memory object, unless a ze_ipc_phys_mem_handle_range_ext_desc_t is chained via `pNext` to capture a range spanning multiple physical memory objects into a single IPC handle.", "The application may call this function from simultaneous threads.", "The implementation of this function must be thread-safe." ], - "hash": "9f9c15706f76982ccbc5eaa076a5a7a108d503dfb3002d57883584d72dfe3a31", - "name": "GetIpcHandleWithProperties", + "hash": "0c93fecc4e19c55c79ca9d1b7001f7c9fcdc783c6cb181c18cae4924ae0e7b4a", + "name": "GetIpcHandle", "params": [ { "desc": "[in] handle of the context object", @@ -45735,11 +46754,6 @@ "name": "ptr", "type": "const void*" }, - { - "desc": "[in][optional] Pointer to extension-specific structure.", - "name": "pNext", - "type": "void*" - }, { "desc": "[out] Returned IPC memory handle", "name": "pIpcHandle", @@ -45801,28 +46815,35 @@ } ], "type": "function", - "version": "1.15" + "version": "1.0" }, - "GetIpcProperties": { - "class": "zeDriver", - "desc": "Retrieves IPC attributes of the driver", + "GetIpcHandleFromFileDescriptorExp": { + "class": "zeMem", + "decl": "static", + "desc": "Creates an IPC memory handle out of a file descriptor", "details": [ + "Handle passed must be a valid file descriptor obtained with ze_external_memory_export_fd_t via zeMemGetAllocProperties or zePhysicalMemGetProperties.", + "Returned IPC handle may contain metadata in addition to the file descriptor.", "The application may call this function from simultaneous threads.", - "The implementation of this function should be lock-free." + "The implementation of this function must be thread-safe." ], - "hash": "3f55d5186d2c4daedc8426a8adfb98ad27492c060c20748bebad12ec50bd5293", - "name": "GetIpcProperties", - "ordinal": "1", + "hash": "85dd8fd011ef561b945d46995f774fa76385cef8b350475fb4fa35684277399e", + "name": "GetIpcHandleFromFileDescriptorExp", "params": [ { - "desc": "[in] handle of the driver instance", - "name": "hDriver", - "type": "ze_driver_handle_t" + "desc": "[in] handle of the context object", + "name": "hContext", + "type": "ze_context_handle_t" }, { - "desc": "[in,out] query result for IPC properties", - "name": "pIpcProperties", - "type": "ze_driver_ipc_properties_t*" + "desc": "[in] file descriptor", + "name": "handle", + "type": "uint64_t" + }, + { + "desc": "[out] Returned IPC memory handle", + "name": "pIpcHandle", + "type": "ze_ipc_mem_handle_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -45869,42 +46890,52 @@ }, { "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hDriver`" + "`nullptr == hContext`" ] }, { "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == pIpcProperties`" + "`nullptr == pIpcHandle`" ] } ], "type": "function", - "version": "1.0" + "version": "1.6" }, - "GetKernelNames": { - "class": "zeModule", - "desc": "Retrieve all kernel names in the module.", + "GetIpcHandleWithProperties": { + "class": "zeMem", + "decl": "static", + "desc": "Creates an IPC memory handle for the specified allocation with properties for the requested handle.", "details": [ + "Takes a pointer to a device or host memory allocation and creates an IPC memory handle for exporting it for use in another process.", + "The pointer must be the base pointer of a device or host memory allocation; i.e. the value returned from zeMemAllocDevice or from zeMemAllocHost, respectively or allocated from zePhysicalMemCreate.", + "The pointer may also be a virtual address that was mapped to a physical memory object via zeVirtualMemMap; in that case, the IPC handle represents the underlying physical memory object.", + "Only one physical memory object may be associated with a single IPC handle at a time; the virtual address range passed must map to exactly one physical memory object, unless a ze_ipc_phys_mem_handle_range_ext_desc_t is chained via `pNext` to capture a range spanning multiple physical memory objects into a single IPC handle.", "The application may call this function from simultaneous threads.", - "The implementation of this function should be lock-free." + "The implementation of this function must be thread-safe." ], - "hash": "0e05374b34a6bf84f993c6c127a9c2e7affdbc11fe96cbedcfa8e306bd18cc21", - "name": "GetKernelNames", + "hash": "9f9c15706f76982ccbc5eaa076a5a7a108d503dfb3002d57883584d72dfe3a31", + "name": "GetIpcHandleWithProperties", "params": [ { - "desc": "[in] handle of the module", - "name": "hModule", - "type": "ze_module_handle_t" + "desc": "[in] handle of the context object", + "name": "hContext", + "type": "ze_context_handle_t" }, { - "desc": "[in,out] pointer to the number of names.\nif count is zero, then the driver shall update the value with the total number of names available.\nif count is greater than the number of names available, then the driver shall update the value with the correct number of names available.\n", - "name": "pCount", - "type": "uint32_t*" + "desc": "[in] pointer to the device memory allocation", + "name": "ptr", + "type": "const void*" }, { - "desc": "[in,out][optional][range(0, *pCount)] array of names of functions.\nif count is less than the number of names available, then driver shall only retrieve that number of names.\n", - "name": "pNames", - "type": "const char**" + "desc": "[in][optional] Pointer to extension-specific structure.", + "name": "pNext", + "type": "void*" + }, + { + "desc": "[out] Returned IPC memory handle", + "name": "pIpcHandle", + "type": "ze_ipc_mem_handle_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -45951,35 +46982,39 @@ }, { "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hModule`" + "`nullptr == hContext`" ] }, { "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == pCount`" + "`nullptr == ptr`", + "`nullptr == pIpcHandle`" ] } ], "type": "function", - "version": "1.0" + "version": "1.15" }, - "GetLastErrorDescription": { - "class": "zer", - "desc": "Retrieves a string describing the last error code returned by the default driver in the current thread.", + "GetIpcProperties": { + "class": "zeDriver", + "desc": "Retrieves IPC attributes of the driver", "details": [ - "String returned is thread local.", - "String is only updated on calls returning an error, i.e., not on calls returning ZE_RESULT_SUCCESS.", - "String may be empty if driver considers error code is already explicit enough to describe cause.", - "Memory pointed to by ppString is owned by the default driver.", - "String returned is null-terminated." + "The application may call this function from simultaneous threads.", + "The implementation of this function should be lock-free." ], - "hash": "41a123fc68e3242443b302fd3aa1f2819b8b79b056a7f323ee959a30e62d6922", - "name": "GetLastErrorDescription", + "hash": "3f55d5186d2c4daedc8426a8adfb98ad27492c060c20748bebad12ec50bd5293", + "name": "GetIpcProperties", + "ordinal": "1", "params": [ { - "desc": "[in,out] pointer to a null-terminated array of characters describing cause of error.", - "name": "ppString", - "type": "const char**" + "desc": "[in] handle of the driver instance", + "name": "hDriver", + "type": "ze_driver_handle_t" + }, + { + "desc": "[in,out] query result for IPC properties", + "name": "pIpcProperties", + "type": "ze_driver_ipc_properties_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -46024,45 +47059,44 @@ { "ZE_RESULT_ERROR_UNKNOWN": [] }, + { + "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hDriver`" + ] + }, { "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == ppString`" + "`nullptr == pIpcProperties`" ] } ], "type": "function", - "version": "1.14" + "version": "1.0" }, - "GetLimits": { - "class": "zesPower", - "desc": "Get power limits", + "GetKernelNames": { + "class": "zeModule", + "desc": "Retrieve all kernel names in the module.", "details": [ "The application may call this function from simultaneous threads.", - "The implementation of this function should be lock-free.", - "[DEPRECATED] Use zesPowerGetLimitsExt." + "The implementation of this function should be lock-free." ], - "hash": "ed0462ffcd8d44a95439a0ea86fbb1bc0e13e357c0d73fabd1d3322abd658e18", - "name": "GetLimits", + "hash": "0e05374b34a6bf84f993c6c127a9c2e7affdbc11fe96cbedcfa8e306bd18cc21", + "name": "GetKernelNames", "params": [ { - "desc": "[in] Handle for the component.", - "name": "hPower", - "type": "zes_pwr_handle_t" - }, - { - "desc": "[in,out][optional] The sustained power limit. If this is null, the current sustained power limits will not be returned.", - "name": "pSustained", - "type": "zes_power_sustained_limit_t*" + "desc": "[in] handle of the module", + "name": "hModule", + "type": "ze_module_handle_t" }, { - "desc": "[in,out][optional] The burst power limit. If this is null, the current peak power limits will not be returned.", - "name": "pBurst", - "type": "zes_power_burst_limit_t*" + "desc": "[in,out] pointer to the number of names.\nif count is zero, then the driver shall update the value with the total number of names available.\nif count is greater than the number of names available, then the driver shall update the value with the correct number of names available.\n", + "name": "pCount", + "type": "uint32_t*" }, { - "desc": "[in,out][optional] The peak power limit. If this is null, the peak power limits will not be returned.", - "name": "pPeak", - "type": "zes_power_peak_limit_t*" + "desc": "[in,out][optional][range(0, *pCount)] array of names of functions.\nif count is less than the number of names available, then driver shall only retrieve that number of names.\n", + "name": "pNames", + "type": "const char**" } ], "return_desc": "[out] ze_result_t API result", @@ -46109,38 +47143,35 @@ }, { "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hPower`" + "`nullptr == hModule`" + ] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == pCount`" ] } ], "type": "function", "version": "1.0" }, - "GetLimitsExt": { - "class": "zesPower", - "desc": "Get power limits", + "GetLastErrorDescription": { + "class": "zer", + "desc": "Retrieves a string describing the last error code returned by the default driver in the current thread.", "details": [ - "The application may call this function from simultaneous threads.", - "The implementation of this function should be lock-free.", - "This function returns all the power limits associated with the supplied power domain." + "String returned is thread local.", + "String is only updated on calls returning an error, i.e., not on calls returning ZE_RESULT_SUCCESS.", + "String may be empty if driver considers error code is already explicit enough to describe cause.", + "Memory pointed to by ppString is owned by the default driver.", + "String returned is null-terminated." ], - "hash": "68f318093a420db4811cba53835f34da4a4fa9ffb3b98d7793765842d0424b8c", - "name": "GetLimitsExt", + "hash": "41a123fc68e3242443b302fd3aa1f2819b8b79b056a7f323ee959a30e62d6922", + "name": "GetLastErrorDescription", "params": [ { - "desc": "[in] Power domain handle instance.", - "name": "hPower", - "type": "zes_pwr_handle_t" - }, - { - "desc": "[in,out] Pointer to the number of power limit descriptors. If count is zero, then the driver shall update the value with the total number of components of this type that are available. If count is greater than the number of components of this type that are available, then the driver shall update the value with the correct number of components.", - "name": "pCount", - "type": "uint32_t*" - }, - { - "desc": "[in,out][optional][range(0, *pCount)] Array of query results for power limit descriptors. If count is less than the number of components of this type that are available, then the driver shall only retrieve that number of components.", - "name": "pSustained", - "type": "zes_power_limit_ext_desc_t*" + "desc": "[in,out] pointer to a null-terminated array of characters describing cause of error.", + "name": "ppString", + "type": "const char**" } ], "return_desc": "[out] ze_result_t API result", @@ -46185,40 +47216,45 @@ { "ZE_RESULT_ERROR_UNKNOWN": [] }, - { - "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hPower`" - ] - }, { "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == pCount`" + "`nullptr == ppString`" ] } ], "type": "function", - "version": "1.0" + "version": "1.14" }, - "GetLimitsExt2": { + "GetLimits": { "class": "zesPower", "desc": "Get power limits", "details": [ "The application may call this function from simultaneous threads.", "The implementation of this function should be lock-free.", - "This function returns the power limit associated with the power domain of the handle." + "[DEPRECATED] Use zesPowerGetLimitsExt." ], - "hash": "92dfbbd3402d925a122dfb7a21e9ccbaf793d570a5f8c457915620fcc18282a2", - "name": "GetLimitsExt2", + "hash": "ed0462ffcd8d44a95439a0ea86fbb1bc0e13e357c0d73fabd1d3322abd658e18", + "name": "GetLimits", "params": [ { - "desc": "[in] Power domain handle instance.", + "desc": "[in] Handle for the component.", "name": "hPower", "type": "zes_pwr_handle_t" }, { - "desc": "[out] Returns limit value in milliwatts for given power domain.", - "name": "pLimit", - "type": "uint32_t*" + "desc": "[in,out][optional] The sustained power limit. If this is null, the current sustained power limits will not be returned.", + "name": "pSustained", + "type": "zes_power_sustained_limit_t*" + }, + { + "desc": "[in,out][optional] The burst power limit. If this is null, the current peak power limits will not be returned.", + "name": "pBurst", + "type": "zes_power_burst_limit_t*" + }, + { + "desc": "[in,out][optional] The peak power limit. If this is null, the peak power limits will not be returned.", + "name": "pPeak", + "type": "zes_power_peak_limit_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -46267,35 +47303,36 @@ "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ "`nullptr == hPower`" ] - }, - { - "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == pLimit`" - ] } ], "type": "function", - "version": "1.16" + "version": "1.0" }, - "GetLinkType": { - "class": "zesFabricPort", - "desc": "Get Fabric port link type", + "GetLimitsExt": { + "class": "zesPower", + "desc": "Get power limits", "details": [ "The application may call this function from simultaneous threads.", - "The implementation of this function should be lock-free." + "The implementation of this function should be lock-free.", + "This function returns all the power limits associated with the supplied power domain." ], - "hash": "ded4dbd69e173ddcbb1a8dfa0aa5d9c019a40c71a09ab024e055ef4dbbad1ca0", - "name": "GetLinkType", + "hash": "68f318093a420db4811cba53835f34da4a4fa9ffb3b98d7793765842d0424b8c", + "name": "GetLimitsExt", "params": [ { - "desc": "[in] Handle for the component.", - "name": "hPort", - "type": "zes_fabric_port_handle_t" + "desc": "[in] Power domain handle instance.", + "name": "hPower", + "type": "zes_pwr_handle_t" }, { - "desc": "[in,out] Will contain details about the link attached to the Fabric port.", - "name": "pLinkType", - "type": "zes_fabric_link_type_t*" + "desc": "[in,out] Pointer to the number of power limit descriptors. If count is zero, then the driver shall update the value with the total number of components of this type that are available. If count is greater than the number of components of this type that are available, then the driver shall update the value with the correct number of components.", + "name": "pCount", + "type": "uint32_t*" + }, + { + "desc": "[in,out][optional][range(0, *pCount)] Array of query results for power limit descriptors. If count is less than the number of components of this type that are available, then the driver shall only retrieve that number of components.", + "name": "pSustained", + "type": "zes_power_limit_ext_desc_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -46342,41 +47379,38 @@ }, { "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hPort`" + "`nullptr == hPower`" ] }, { "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == pLinkType`" + "`nullptr == pCount`" ] } ], "type": "function", "version": "1.0" }, - "GetMemoryAccessProperties": { - "analogue": [ - "clGetDeviceInfo" - ], - "class": "zeDevice", - "desc": "Retrieves memory access properties of the device.", + "GetLimitsExt2": { + "class": "zesPower", + "desc": "Get power limits", "details": [ "The application may call this function from simultaneous threads.", - "The implementation of this function should be lock-free." + "The implementation of this function should be lock-free.", + "This function returns the power limit associated with the power domain of the handle." ], - "hash": "e874d3ac0d34ac6938b4be6d38888e2f568d939aef6960e1d5803d6258142613", - "name": "GetMemoryAccessProperties", - "ordinal": "1", + "hash": "92dfbbd3402d925a122dfb7a21e9ccbaf793d570a5f8c457915620fcc18282a2", + "name": "GetLimitsExt2", "params": [ { - "desc": "[in] handle of the device", - "name": "hDevice", - "type": "ze_device_handle_t" + "desc": "[in] Power domain handle instance.", + "name": "hPower", + "type": "zes_pwr_handle_t" }, { - "desc": "[in,out] query result for memory access properties", - "name": "pMemAccessProperties", - "type": "ze_device_memory_access_properties_t*" + "desc": "[out] Returns limit value in milliwatts for given power domain.", + "name": "pLimit", + "type": "uint32_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -46423,49 +47457,37 @@ }, { "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hDevice`" + "`nullptr == hPower`" ] }, { "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == pMemAccessProperties`" + "`nullptr == pLimit`" ] } ], "type": "function", - "version": "1.0" + "version": "1.16" }, - "GetMemoryProperties": { - "analogue": [ - "clGetDeviceInfo" - ], - "class": "zeDevice", - "desc": "Retrieves local memory properties of the device.", + "GetLinkType": { + "class": "zesFabricPort", + "desc": "Get Fabric port link type", "details": [ - "Properties are reported for each physical memory type supported by the device.", - "Multiple calls to this function will return properties in the same order.", - "The order in which the properties are returned defines the device's local memory ordinal.", "The application may call this function from simultaneous threads.", "The implementation of this function should be lock-free." ], - "hash": "f28eb5727554e11a61cdab0d97af8c41880e56e379c2594800a0226c6e72340b", - "name": "GetMemoryProperties", - "ordinal": "1", + "hash": "ded4dbd69e173ddcbb1a8dfa0aa5d9c019a40c71a09ab024e055ef4dbbad1ca0", + "name": "GetLinkType", "params": [ { - "desc": "[in] handle of the device", - "name": "hDevice", - "type": "ze_device_handle_t" - }, - { - "desc": "[in,out] pointer to the number of memory properties.\nif count is zero, then the driver shall update the value with the total number of memory properties available.\nif count is greater than the number of memory properties available, then the driver shall update the value with the correct number of memory properties available.\n", - "name": "pCount", - "type": "uint32_t*" + "desc": "[in] Handle for the component.", + "name": "hPort", + "type": "zes_fabric_port_handle_t" }, { - "desc": "[in,out][optional][range(0, *pCount)] array of query results for memory properties.\nif count is less than the number of memory properties available, then driver shall only retrieve that number of memory properties.\n", - "name": "pMemProperties", - "type": "ze_device_memory_properties_t*" + "desc": "[in,out] Will contain details about the link attached to the Fabric port.", + "name": "pLinkType", + "type": "zes_fabric_link_type_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -46512,43 +47534,41 @@ }, { "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hDevice`" + "`nullptr == hPort`" ] }, { "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == pCount`" + "`nullptr == pLinkType`" ] } ], "type": "function", "version": "1.0" }, - "GetMemoryPropertiesExp": { + "GetMemoryAccessProperties": { "analogue": [ - "None" + "clGetDeviceInfo" ], - "class": "zeImage", - "decl": "static", - "desc": "Query image memory properties.", + "class": "zeDevice", + "desc": "Retrieves memory access properties of the device.", "details": [ "The application may call this function from simultaneous threads.", - "The implementation of this function must be thread-safe.", - "The implementation must support ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME extension." + "The implementation of this function should be lock-free." ], - "hash": "573043a1d9ef253c5802bfac3cdf26568142e4e0748351fc4cd7a6a4cfc4856a", - "name": "GetMemoryPropertiesExp", - "ordinal": "0", + "hash": "e874d3ac0d34ac6938b4be6d38888e2f568d939aef6960e1d5803d6258142613", + "name": "GetMemoryAccessProperties", + "ordinal": "1", "params": [ { - "desc": "[in] handle of image object", - "name": "hImage", - "type": "ze_image_handle_t" + "desc": "[in] handle of the device", + "name": "hDevice", + "type": "ze_device_handle_t" }, { - "desc": "[in,out] query result for image memory properties.", - "name": "pMemoryProperties", - "type": "ze_image_memory_properties_exp_t*" + "desc": "[in,out] query result for memory access properties", + "name": "pMemAccessProperties", + "type": "ze_device_memory_access_properties_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -46595,37 +47615,209 @@ }, { "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hImage`" + "`nullptr == hDevice`" ] }, { "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == pMemoryProperties`" + "`nullptr == pMemAccessProperties`" ] } ], "type": "function", - "version": "1.2" + "version": "1.0" }, - "GetMode": { - "class": "zesStandby", - "desc": "Get the current standby promotion mode", + "GetMemoryProperties": { + "analogue": [ + "clGetDeviceInfo" + ], + "class": "zeDevice", + "desc": "Retrieves local memory properties of the device.", "details": [ + "Properties are reported for each physical memory type supported by the device.", + "Multiple calls to this function will return properties in the same order.", + "The order in which the properties are returned defines the device's local memory ordinal.", "The application may call this function from simultaneous threads.", "The implementation of this function should be lock-free." ], - "hash": "5b35e78c5cabe67779534fa696ed6b8e877734f8e052462b4e2f0f25c9625092", - "name": "GetMode", + "hash": "f28eb5727554e11a61cdab0d97af8c41880e56e379c2594800a0226c6e72340b", + "name": "GetMemoryProperties", + "ordinal": "1", "params": [ { - "desc": "[in] Handle for the component.", - "name": "hStandby", - "type": "zes_standby_handle_t" + "desc": "[in] handle of the device", + "name": "hDevice", + "type": "ze_device_handle_t" }, { - "desc": "[in,out] Will contain the current standby mode.", - "name": "pMode", - "type": "zes_standby_promo_mode_t*" + "desc": "[in,out] pointer to the number of memory properties.\nif count is zero, then the driver shall update the value with the total number of memory properties available.\nif count is greater than the number of memory properties available, then the driver shall update the value with the correct number of memory properties available.\n", + "name": "pCount", + "type": "uint32_t*" + }, + { + "desc": "[in,out][optional][range(0, *pCount)] array of query results for memory properties.\nif count is less than the number of memory properties available, then driver shall only retrieve that number of memory properties.\n", + "name": "pMemProperties", + "type": "ze_device_memory_properties_t*" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "ZE_RESULT_SUCCESS": [] + }, + { + "ZE_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "ZE_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "ZE_RESULT_ERROR_UNKNOWN": [] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hDevice`" + ] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == pCount`" + ] + } + ], + "type": "function", + "version": "1.0" + }, + "GetMemoryPropertiesExp": { + "analogue": [ + "None" + ], + "class": "zeImage", + "decl": "static", + "desc": "Query image memory properties.", + "details": [ + "The application may call this function from simultaneous threads.", + "The implementation of this function must be thread-safe.", + "The implementation must support ZE_IMAGE_MEMORY_PROPERTIES_EXP_NAME extension." + ], + "hash": "573043a1d9ef253c5802bfac3cdf26568142e4e0748351fc4cd7a6a4cfc4856a", + "name": "GetMemoryPropertiesExp", + "ordinal": "0", + "params": [ + { + "desc": "[in] handle of image object", + "name": "hImage", + "type": "ze_image_handle_t" + }, + { + "desc": "[in,out] query result for image memory properties.", + "name": "pMemoryProperties", + "type": "ze_image_memory_properties_exp_t*" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "ZE_RESULT_SUCCESS": [] + }, + { + "ZE_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "ZE_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "ZE_RESULT_ERROR_UNKNOWN": [] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hImage`" + ] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == pMemoryProperties`" + ] + } + ], + "type": "function", + "version": "1.2" + }, + "GetMode": { + "class": "zesStandby", + "desc": "Get the current standby promotion mode", + "details": [ + "The application may call this function from simultaneous threads.", + "The implementation of this function should be lock-free." + ], + "hash": "5b35e78c5cabe67779534fa696ed6b8e877734f8e052462b4e2f0f25c9625092", + "name": "GetMode", + "params": [ + { + "desc": "[in] Handle for the component.", + "name": "hStandby", + "type": "zes_standby_handle_t" + }, + { + "desc": "[in,out] Will contain the current standby mode.", + "name": "pMode", + "type": "zes_standby_promo_mode_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -46684,6 +47876,82 @@ "type": "function", "version": "1.0" }, + "GetModuleHandle": { + "class": "zeKernel", + "desc": "Retrieve the handle of the module from which the kernel was created.", + "details": [ + "The application may call this function from simultaneous threads." + ], + "hash": "2efbb433a9daec21aecb4679ed2cb8e6e0896972e7c1de9a638ff16d30573b36", + "name": "GetModuleHandle", + "params": [ + { + "desc": "[in] handle of the kernel", + "name": "hKernel", + "type": "ze_kernel_handle_t" + }, + { + "desc": "[out] handle of the module the kernel was created from", + "name": "phModule", + "type": "ze_module_handle_t*" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "ZE_RESULT_SUCCESS": [] + }, + { + "ZE_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "ZE_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "ZE_RESULT_ERROR_UNKNOWN": [] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hKernel`" + ] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == phModule`" + ] + } + ], + "type": "function", + "version": "1.18" + }, "GetModuleProperties": { "class": "zeDevice", "desc": "Retrieves module properties of the device", @@ -49923,7 +51191,7 @@ }, { "ZE_RESULT_ERROR_INVALID_ARGUMENT": [ - "the thread argument specifies more than one or a non-existant thread" + "the thread argument specifies more than one or a non-existent thread" ] } ], @@ -50260,7 +51528,8 @@ "details": [ "The application may call this function from simultaneous threads.", "The implementation of this function should be lock-free.", - "This function returns the different power usage values associated with the power domain." + "This function returns the different power usage values associated with the power domain.", + "Computing the average power usage may cause this API to wait and return only after the average power is computed over an interval. Applications that do not need it should pass `nullptr` for `pAveragePower` to reduce the time taken by this function." ], "hash": "b756db7d937321fb7259dfb67be48953e0e2db635647a7610f8770b2d025598e", "name": "GetUsage", @@ -50271,12 +51540,12 @@ "type": "zes_pwr_handle_t" }, { - "desc": "[out] Returns the instant power usage in milliwatts.", + "desc": "[out][optional] Returns the instant power usage in milliwatts. If this is `nullptr`, the instant power usage will not be returned.", "name": "pInstantPower", "type": "uint32_t*" }, { - "desc": "[out] Returns the average power usage in milliwatts.", + "desc": "[out][optional] Returns the average power usage in milliwatts. If this is `nullptr`, the average power usage will not be returned.", "name": "pAveragePower", "type": "uint32_t*" } @@ -50302,15 +51571,9 @@ { "ZE_RESULT_ERROR_INVALID_ARGUMENT": [] }, - { - "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [] - }, { "ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] }, - { - "ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] - }, { "ZE_RESULT_ERROR_NOT_AVAILABLE": [] }, @@ -50330,8 +51593,17 @@ }, { "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == pInstantPower`", - "`nullptr == pAveragePower`" + "`(nullptr == pInstantPower) && (nullptr == pAveragePower)`" + ] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [ + "The requested power usage value is not supported on this power domain." + ] + }, + { + "ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [ + "User does not have permissions to request this feature." ] } ], @@ -50841,7 +52113,7 @@ "type": "zes_overclock_handle_t" }, { - "desc": "[in] Voltage or Freqency point to read.", + "desc": "[in] Voltage or Frequency point to read.", "name": "VFType", "type": "zes_vf_type_t" }, @@ -52127,7 +53399,7 @@ "ordinal": "0", "params": [ { - "desc": "[in] initialization flags.\ncurrently unused, must be 0 (default).\n", + "desc": "[in] initialization flags. This should be 0 or a combination of zes_init_flags_t values.\n", "init": "0", "name": "flags", "type": "zes_init_flags_t" @@ -52174,7 +53446,7 @@ }, { "ZE_RESULT_ERROR_INVALID_ENUMERATION": [ - "`0x1 < flags`" + "`0x7 < flags`" ] }, { @@ -52390,7 +53662,9 @@ "Recorded regular events (not counter-based) are shared between executable graph instances; the application is responsible for avoiding data races during concurrent execution of multiple graph instances.", "Recorded internal counter-based events (i.e. without ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL) may be used only for synchronization within the graph. Their state is tied to the underlying execution queue and is not shared between executable graph instances.", "Recorded external counter-based events (i.e. with ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL) may be used to synchronize the graph with device commands submitted outside the graph (for example, before or after zeCommandListAppendGraphExt) and with the host. External counter-based events may incur additional overhead compared to internal counter-based events.", - "Resources used in captured commands (e.g. buffers passed to kernels as arguments) are shared between instances; the application is responsible for avoiding data races during concurrent execution." + "Resources used in captured commands (e.g. buffers passed to kernels as arguments) are shared between instances; the application is responsible for avoiding data races during concurrent execution.", + "The function returns `ZE_RESULT_ERROR_INVALID_GRAPH` when the recorded graph is invalid, for example when it contains forks that were never joined back to the primary command list.", + "The function returns `ZE_RESULT_ERROR_INVALID_ARGUMENT` when graph capture has not been ended with ::zeCommandListEndGraphCaptureExt." ], "hash": "0f64e2a144987e229595eeed9a0c6462c877b64db727a98abbfcfed4df0ed7ae", "name": "InstantiateExt", @@ -52462,6 +53736,9 @@ "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ "`nullptr == phExecutableGraph`" ] + }, + { + "ZE_RESULT_ERROR_INVALID_GRAPH": [] } ], "type": "function", @@ -54390,30 +55667,95 @@ "type": "function", "version": "1.0" }, - "PciGetBars": { - "class": "zesDevice", - "desc": "Get information about each configured bar", - "details": [ - "The application may call this function from simultaneous threads.", - "The implementation of this function should be lock-free." - ], - "hash": "88ba4b62a295f7ab057dac57aabd8ab6e46cd95e29f99e9c4c094d837c6d141d", - "name": "PciGetBars", + "PauseCaptureExt": { + "class": "zeGraph", + "desc": "Pauses recording to the specified graph. Affected immediate command lists (both primary command lists and child command lists from which graph was recording) can be reused for any purpose during this pause without affecting the paused recording.", + "hash": "a2ca840ebd88f209b9ee43ba2b75a1865732fb62b37263416a98f3171ef88f34", + "name": "PauseCaptureExt", "params": [ { - "desc": "[in] Sysman handle of the device.", - "name": "hDevice", - "type": "zes_device_handle_t" - }, - { - "desc": "[in,out] pointer to the number of PCI bars.\nif count is zero, then the driver shall update the value with the total number of PCI bars that are setup.\nif count is greater than the number of PCI bars that are setup, then the driver shall update the value with the correct number of PCI bars.\n", - "name": "pCount", - "type": "uint32_t*" - }, - { - "desc": "[in,out][optional][range(0, *pCount)] array of information about setup PCI bars.\nif count is less than the number of PCI bars that are setup, then the driver shall only retrieve information about that number of PCI bars.\n", - "name": "pProperties", - "type": "zes_pci_bar_properties_t*" + "desc": "[in] handle to the graph to pause capture", + "name": "hGraph", + "type": "ze_graph_handle_t" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "ZE_RESULT_SUCCESS": [] + }, + { + "ZE_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "ZE_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "ZE_RESULT_ERROR_UNKNOWN": [] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hGraph`" + ] + }, + { + "ZE_RESULT_ERROR_INVALID_ARGUMENT": [ + "Graph is not in a recording state" + ] + } + ], + "type": "function", + "version": "1.18" + }, + "PciGetBars": { + "class": "zesDevice", + "desc": "Get information about each configured bar", + "details": [ + "The application may call this function from simultaneous threads.", + "The implementation of this function should be lock-free." + ], + "hash": "88ba4b62a295f7ab057dac57aabd8ab6e46cd95e29f99e9c4c094d837c6d141d", + "name": "PciGetBars", + "params": [ + { + "desc": "[in] Sysman handle of the device.", + "name": "hDevice", + "type": "zes_device_handle_t" + }, + { + "desc": "[in,out] pointer to the number of PCI bars.\nif count is zero, then the driver shall update the value with the total number of PCI bars that are setup.\nif count is greater than the number of PCI bars that are setup, then the driver shall update the value with the correct number of PCI bars.\n", + "name": "pCount", + "type": "uint32_t*" + }, + { + "desc": "[in,out][optional][range(0, *pCount)] array of information about setup PCI bars.\nif count is less than the number of PCI bars that are setup, then the driver shall only retrieve information about that number of PCI bars.\n", + "name": "pProperties", + "type": "zes_pci_bar_properties_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -54964,6 +56306,7 @@ "details": [ "This call may be used for IPC handles previously obtained with either zeMemGetIpcHandle or with ze_external_memory_export_fd_t via zeMemGetAllocProperties or zePhysicalMemGetProperties.\n", "Upon call, driver may release any underlying resources associated with the IPC handle.\nFor instance, it may close the file descriptor contained in the IPC handle, if such type of handle is being used by the driver.\n", + "When the IPC handle encodes multiple physical memory objects (for example, a handle representing a range of objects), the driver releases **all** of the underlying resources it holds for that handle, not just one; for instance, it closes every file descriptor the driver opened to represent the encoded objects.", "This call does not free the original allocation for which the IPC handle was created.", "This function may **not** be called from simultaneous threads with the same IPC handle.", "The implementation of this function should be lock-free." @@ -56880,6 +58223,71 @@ "type": "function", "version": "1.0" }, + "ResumeCaptureExt": { + "class": "zeGraph", + "desc": "Resumes capturing commands to the graph after a pause.", + "hash": "d5b3f4ecc3e1a35912d01e84cac8d94434f8f7fdd585707ff72b5d38273c0c96", + "name": "ResumeCaptureExt", + "params": [ + { + "desc": "[in] handle to the graph to resume capture", + "name": "hGraph", + "type": "ze_graph_handle_t" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "ZE_RESULT_SUCCESS": [] + }, + { + "ZE_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "ZE_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "ZE_RESULT_ERROR_UNKNOWN": [] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hGraph`" + ] + }, + { + "ZE_RESULT_ERROR_INVALID_ARGUMENT": [ + "Graph is not in a paused state" + ] + } + ], + "type": "function", + "version": "1.18" + }, "RunTests": { "class": "zesDiagnostics", "desc": "Run a diagnostics test suite, either all tests or a subset of tests.", @@ -58797,6 +60205,91 @@ "type": "function", "version": "1.0" }, + "SetHealthStatusExt": { + "class": "zesDevice", + "desc": "Set device health status", + "details": [ + "This function sets the health status of the device.", + "The health status is persisted to non-volatile memory.", + "Setting health status requires appropriate permissions.", + "The application should not call this function from simultaneous threads.", + "The implementation of this function should be lock-free." + ], + "hash": "e9efbf4a0ba8157a8156d77b9e9185d6510fe8b7ec3aa3019f3d0d1538590a0b", + "name": "SetHealthStatusExt", + "params": [ + { + "desc": "[in] Sysman handle of the device.", + "name": "hDevice", + "type": "zes_device_handle_t" + }, + { + "desc": "[in] New health status to be set for the device.", + "name": "health", + "type": "zes_device_health_status_ext_t" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "ZE_RESULT_SUCCESS": [] + }, + { + "ZE_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "ZE_RESULT_ERROR_UNKNOWN": [] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hDevice`" + ] + }, + { + "ZE_RESULT_ERROR_INVALID_ENUMERATION": [ + "`ZES_DEVICE_HEALTH_STATUS_EXT_FAILED < health`" + ] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION": [] + }, + { + "ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [ + "User does not have permissions to set health status." + ] + } + ], + "type": "function", + "version": "1.18" + }, "SetIndirectAccess": { "class": "zeKernel", "desc": "Sets kernel indirect access flags.", @@ -59281,27 +60774,26 @@ "type": "function", "version": "1.5" }, - "SetPrologues": { - "class": "zetTracerExp", - "desc": "Sets the collection of callbacks to be executed **before** driver execution.", + "SetPriorityExt": { + "class": "zeCommandQueue", + "desc": "Sets the priority of a command queue.", "details": [ - "@deprecated This function is not supported in L0 drivers and has been replaced by the Loader Tracing Layer. See the Loader Tracing documentation for more details.", - "The application only needs to set the function pointers it is interested in receiving; all others should be 'nullptr'", - "The application must ensure that no other threads are executing functions for which the tracing functions are changing.", - "The application must **not** call this function from simultaneous threads with the same tracer handle." + "The application may call this function from simultaneous threads.", + "This function changes the priority of an existing command queue, overriding the priority specified at creation through ze_command_queue_desc_t; the updated value is reported by zeCommandQueueGetPriority.", + "Whether the new priority affects commands already submitted to the command queue, or only commands submitted after this call, is implementation-defined." ], - "hash": "3757c0ce726200f3b8edc93579a5460a058c240b7c52a06ff74e4756ebfc3eb0", - "name": "SetPrologues", + "hash": "f40a9e20233500ed749859bd4117c760e6a2c94773b9991021428320ceee1646", + "name": "SetPriorityExt", "params": [ { - "desc": "[in] handle of the tracer", - "name": "hTracer", - "type": "zet_tracer_exp_handle_t" + "desc": "[in] handle of the command queue", + "name": "hCommandQueue", + "type": "ze_command_queue_handle_t" }, { - "desc": "[in] pointer to table of 'core' callback function pointers", - "name": "pCoreCbs", - "type": "zet_core_callbacks_t*" + "desc": "[in] priority to set for the command queue", + "name": "priority", + "type": "ze_command_queue_priority_t" } ], "return_desc": "[out] ze_result_t API result", @@ -59348,38 +60840,120 @@ }, { "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hTracer`" + "`nullptr == hCommandQueue`" ] }, { - "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == pCoreCbs`" + "ZE_RESULT_ERROR_INVALID_ENUMERATION": [ + "`ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < priority`" ] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION": [] } ], "type": "function", - "version": "1.0" + "version": "1.18" }, - "SetRange": { - "class": "zesFrequency", - "desc": "Set frequency range between which the hardware can operate.", + "SetPrologues": { + "class": "zetTracerExp", + "desc": "Sets the collection of callbacks to be executed **before** driver execution.", "details": [ - "The application may call this function with the frequency range min and max values set to `-1` to request the frequency be (re)set to the default values.", - "The application may call this function from simultaneous threads.", - "The implementation of this function should be lock-free." + "@deprecated This function is not supported in L0 drivers and has been replaced by the Loader Tracing Layer. See the Loader Tracing documentation for more details.", + "The application only needs to set the function pointers it is interested in receiving; all others should be 'nullptr'", + "The application must ensure that no other threads are executing functions for which the tracing functions are changing.", + "The application must **not** call this function from simultaneous threads with the same tracer handle." ], - "hash": "e510f70acdcb9a652fda8f2d444a9c7d0c4fcd724de88d78b34d1ef7c4248a2d", - "name": "SetRange", + "hash": "3757c0ce726200f3b8edc93579a5460a058c240b7c52a06ff74e4756ebfc3eb0", + "name": "SetPrologues", "params": [ { - "desc": "[in] Handle for the component.", - "name": "hFrequency", - "type": "zes_freq_handle_t" + "desc": "[in] handle of the tracer", + "name": "hTracer", + "type": "zet_tracer_exp_handle_t" }, { - "desc": "[in] The limits between which the hardware can operate for the specified domain.", - "name": "pLimits", - "type": "const zes_freq_range_t*" + "desc": "[in] pointer to table of 'core' callback function pointers", + "name": "pCoreCbs", + "type": "zet_core_callbacks_t*" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "ZE_RESULT_SUCCESS": [] + }, + { + "ZE_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "ZE_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "ZE_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "ZE_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "ZE_RESULT_ERROR_UNKNOWN": [] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hTracer`" + ] + }, + { + "ZE_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == pCoreCbs`" + ] + } + ], + "type": "function", + "version": "1.0" + }, + "SetRange": { + "class": "zesFrequency", + "desc": "Set frequency range between which the hardware can operate.", + "details": [ + "The application may call this function with the frequency range min and max values set to `-1` to request the frequency be (re)set to the default values.", + "The application may call this function from simultaneous threads.", + "The implementation of this function should be lock-free." + ], + "hash": "e510f70acdcb9a652fda8f2d444a9c7d0c4fcd724de88d78b34d1ef7c4248a2d", + "name": "SetRange", + "params": [ + { + "desc": "[in] Handle for the component.", + "name": "hFrequency", + "type": "zes_freq_handle_t" + }, + { + "desc": "[in] The limits between which the hardware can operate for the specified domain.", + "name": "pLimits", + "type": "const zes_freq_range_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -59681,7 +61255,7 @@ "type": "zes_sched_handle_t" }, { - "desc": "[in] The properties to use when configurating this mode.", + "desc": "[in] The properties to use when configuring this mode.", "name": "pProperties", "type": "zes_sched_timeout_properties_t*" }, @@ -59769,7 +61343,7 @@ "type": "zes_sched_handle_t" }, { - "desc": "[in] The properties to use when configurating this mode.", + "desc": "[in] The properties to use when configuring this mode.", "name": "pProperties", "type": "zes_sched_timeslice_properties_t*" }, @@ -59856,7 +61430,7 @@ "type": "zes_overclock_handle_t" }, { - "desc": "[in] Voltage or Freqency point to read.", + "desc": "[in] Voltage or Frequency point to read.", "name": "VFType", "type": "zes_vf_type_t" }, @@ -61907,6 +63481,13 @@ "value": "\"ZES_extension_device_state\"", "version": "1.17" }, + "ZES_DEVICE_HEALTH_EXT_NAME": { + "desc": "Device Health Extension Name", + "name": "ZES_DEVICE_HEALTH_EXT_NAME", + "type": "macro", + "value": "\"ZES_extension_device_health\"", + "version": "1.18" + }, "ZES_DIAG_FIRST_TEST_INDEX": { "desc": "Diagnostic test index to use for the very first test.", "name": "ZES_DIAG_FIRST_TEST_INDEX", @@ -61984,6 +63565,20 @@ "value": "\"ZES_extension_mem_bandwidth_counter_bits_properties\"", "version": "1.8" }, + "ZES_MEMORY_VENDOR_INFO_EXT_NAME": { + "desc": "Memory Vendor Info Extension Name", + "name": "ZES_MEMORY_VENDOR_INFO_EXT_NAME", + "type": "macro", + "value": "\"ZES_extension_memory_vendor_info\"", + "version": "1.18" + }, + "ZES_MEMORY_VENDOR_NAME_EXT_SIZE": { + "desc": "Maximum memory vendor name string size", + "name": "ZES_MEMORY_VENDOR_NAME_EXT_SIZE", + "type": "macro", + "value": "256", + "version": "1.18" + }, "ZES_MEM_PAGE_OFFLINE_STATE_EXP_NAME": { "desc": "Memory State Extension Name", "name": "ZES_MEM_PAGE_OFFLINE_STATE_EXP_NAME", @@ -62265,7 +63860,7 @@ "desc": "Current API version as a macro", "name": "ZE_API_VERSION_CURRENT_M", "type": "macro", - "value": "ZE_MAKE_VERSION( 1, 17 )", + "value": "ZE_MAKE_VERSION( 1, 18 )", "version": "1.10" }, "ZE_BANDWIDTH_PROPERTIES_EXP_NAME": { @@ -62326,13 +63921,27 @@ "value": "\"ZE_experimental_command_list_clone\"", "version": "1.9" }, + "ZE_COMMAND_QUEUE_SET_PRIORITY_EXT_NAME": { + "desc": "Command Queue Set Priority Extension Name", + "name": "ZE_COMMAND_QUEUE_SET_PRIORITY_EXT_NAME", + "type": "macro", + "value": "\"ZE_extension_command_queue_set_priority\"", + "version": "1.18" + }, "ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME": { - "desc": "Power Saving Hint Extension Name", + "desc": "Power Saving Hint Extension Name. @deprecated since 1.18: Use ZE_CONTEXT_POWER_SAVING_HINT_EXT_NAME instead.", "name": "ZE_CONTEXT_POWER_SAVING_HINT_EXP_NAME", "type": "macro", "value": "\"ZE_experimental_power_saving_hint\"", "version": "1.2" }, + "ZE_CONTEXT_POWER_SAVING_HINT_EXT_NAME": { + "desc": "Power Saving Hint Extension Name", + "name": "ZE_CONTEXT_POWER_SAVING_HINT_EXT_NAME", + "type": "macro", + "value": "\"ZE_extension_power_saving_hint\"", + "version": "1.18" + }, "ZE_DEVICE_COMPUTE_DOTPRODUCT_PROPERTIES_EXT_NAME": { "desc": "Device Compute DotProduct Property Extension Name", "name": "ZE_DEVICE_COMPUTE_DOTPRODUCT_PROPERTIES_EXT_NAME", @@ -62361,6 +63970,13 @@ "value": "\"ZE_extension_device_memory_properties\"", "version": "1.4" }, + "ZE_DEVICE_NPU_PROPERTIES_EXT_NAME": { + "desc": "NPU Device Properties Extension Name", + "name": "ZE_DEVICE_NPU_PROPERTIES_EXT_NAME", + "type": "macro", + "value": "\"ZE_extension_device_npu_properties\"", + "version": "1.18" + }, "ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_NAME": { "desc": "Device Usable Memory Size Properties Extension Name", "name": "ZE_DEVICE_USABLEMEM_SIZE_PROPERTIES_EXT_NAME", @@ -62531,6 +64147,13 @@ "value": "\"ZE_experimental_immediate_command_list_append\"", "version": "1.9" }, + "ZE_INIT_DRIVER_APP_VERSION_EXT_NAME": { + "desc": "Init Driver Application Version Extension Name", + "name": "ZE_INIT_DRIVER_APP_VERSION_EXT_NAME", + "type": "macro", + "value": "\"ZE_extension_init_driver_app_version\"", + "version": "1.18" + }, "ZE_IPC_MEM_HANDLE_TYPE_EXT_NAME": { "desc": "IPC Memory Handle Type Extension Name", "name": "ZE_IPC_MEM_HANDLE_TYPE_EXT_NAME", @@ -62538,6 +64161,13 @@ "value": "\"ZE_extension_ipc_mem_handle_type\"", "version": "1.15" }, + "ZE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_NAME": { + "desc": "IPC Physical Memory Range Extension Name", + "name": "ZE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_NAME", + "type": "macro", + "value": "\"ZE_extension_ipc_phys_mem_handle_range\"", + "version": "1.18" + }, "ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_NAME": { "desc": "Kernel Max Group Size Properties Extension Name", "name": "ZE_KERNEL_MAX_GROUP_SIZE_PROPERTIES_EXT_NAME", @@ -63020,6 +64650,25 @@ "type": "struct", "version": "1.0" }, + "ze_compiler_name_version_t": { + "class": "zeDevice", + "desc": "Name and version entry returned for the OpenCL C compiler-info lists", + "members": [ + { + "desc": "[out] packed version of the entry", + "name": "version", + "type": "uint32_t" + }, + { + "desc": "[out] null-terminated name", + "name": "name[ZE_MAX_EXTENSION_NAME]", + "type": "char" + } + ], + "name": "ze_compiler_name_version_t", + "type": "struct", + "version": "1.18" + }, "ze_context_desc_t": { "base": "ze_base_desc_t", "class": "zeContext", @@ -63051,7 +64700,7 @@ "ze_context_power_saving_hint_exp_desc_t": { "base": "ze_base_desc_t", "class": "zeContext", - "desc": "Extended context descriptor containing power saving hint.", + "desc": "Extended context descriptor containing power saving hint. @deprecated since 1.18: Use ze_context_power_saving_hint_ext_desc_t instead.", "members": [ { "desc": "[in] type of this structure", @@ -63076,6 +64725,34 @@ "type": "struct", "version": "1.2" }, + "ze_context_power_saving_hint_ext_desc_t": { + "base": "ze_base_desc_t", + "class": "zeContext", + "desc": "Extended context descriptor containing power saving hint.", + "members": [ + { + "desc": "[in] type of this structure", + "init": "ZE_STRUCTURE_TYPE_CONTEXT_POWER_SAVING_HINT_EXT_DESC", + "name": "stype", + "type": "ze_structure_type_t" + }, + { + "desc": "[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).", + "init": "nullptr", + "name": "pNext", + "type": "const void*" + }, + { + "desc": "[in] power saving hint (default value = 0). This is value from [0,100] and can use pre-defined settings from ze_power_saving_hint_ext_type_t.\n", + "init": "0", + "name": "hint", + "type": "uint32_t" + } + ], + "name": "ze_context_power_saving_hint_ext_desc_t", + "type": "struct", + "version": "1.18" + }, "ze_copy_bandwidth_exp_properties_t": { "base": "ze_base_properties_t", "class": "zeCommandQueue", @@ -63174,7 +64851,7 @@ "type": "size_t" }, { - "desc": "[in] user programmed slice pitch , must be multiple of rowPitch. For 2D image arrary or a slice of a 3D image array - this pitch should be >= rowPitch * image_height . For 1D iamge array >= rowPitch.\n", + "desc": "[in] user programmed slice pitch , must be multiple of rowPitch. For 2D image array or a slice of a 3D image array - this pitch should be >= rowPitch * image_height . For 1D image array >= rowPitch.\n", "name": "slicePitch", "type": "size_t" } @@ -63824,6 +65501,96 @@ "type": "struct", "version": "1.0" }, + "ze_device_npu_properties_ext_t": { + "base": "ze_base_properties_t", + "class": "zeDevice", + "desc": "NPU device properties queried using zeDeviceGetProperties", + "details": [ + "This structure may be returned from zeDeviceGetProperties via the `pNext` member of ze_device_properties_t.", + "Applicable only when the `type` member of ze_device_properties_t is ZE_DEVICE_TYPE_VPU.", + "Exposes NPU-native topology, clock, timestamp frequency, on-chip SRAM, and compiler capability information that has no clean analogue in the GPU-oriented base ze_device_properties_t struct.", + "`compilerVersion` and `maxOVOpsetVersionSupported` describe the compiler bundled with the driver, and report identical values for every device reported by a given driver instance.", + "The base ze_device_properties_t fields remain populated on NPU devices for backward compatibility with consumers that predate this extension. New consumers should prefer the NPU-native fields exposed here.", + "Identity (`vendorId`, `deviceId`, `subdeviceId`, `uuid`, `name`), capabilities (`flags`, `maxMemAllocSize`, `maxHardwareContexts`, `maxCommandQueuePriority`), and host/global timestamp validity (`timestampValidBits`) continue to be sourced from the base ze_device_properties_t struct. NPU does not implement kernel timestamp APIs; `kernelTimestampValidBits` is 0 on NPU devices." + ], + "members": [ + { + "desc": "[in] type of this structure", + "init": "ZE_STRUCTURE_TYPE_DEVICE_NPU_PROPERTIES_EXT", + "name": "stype", + "type": "ze_structure_type_t" + }, + { + "desc": "[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).", + "init": "nullptr", + "name": "pNext", + "type": "void*" + }, + { + "desc": "[out] Total number of NCE tiles enabled on the device. Equivalent to popcount(tileEnableMask). Supersedes the `numSlices` member of ze_device_properties_t for NPU devices.", + "name": "tileCount", + "type": "uint32_t" + }, + { + "desc": "[out] Bitmask of enabled NCE tiles. popcount(tileEnableMask) == tileCount.", + "name": "tileEnableMask", + "type": "uint32_t" + }, + { + "desc": "[out] Total number of SHAVE (VLIW) vector processors across all tiles. Supersedes the `numEUsPerSubslice` member of ze_device_properties_t for NPU devices.", + "name": "totalShaveCount", + "type": "uint32_t" + }, + { + "desc": "[out] Multiply-accumulate (MAC) units per tile at INT8 x INT8 precision (baseline). Throughput at other precisions: 2x for INT8 x INT4, 0.5x for FP16 x FP16, 0.5x for INT16 x INT8, 1x for INT16 x INT4. Supersedes half the `physicalEUSimdWidth` member of ze_device_properties_t for NPU devices.", + "name": "int8x8MacsPerTile", + "type": "uint32_t" + }, + { + "desc": "[out] Total DPU MAC units across the device. Derived as tileCount * int8x8MacsPerTile.", + "name": "totalDpuMacs", + "type": "uint32_t" + }, + { + "desc": "[out] Number of compute engines on the device.", + "name": "numComputeEngines", + "type": "uint32_t" + }, + { + "desc": "[out] Number of copy (DMA) engines on the device.", + "name": "numCopyEngines", + "type": "uint32_t" + }, + { + "desc": "[out] DPU compute clock rate, in Hz. Supersedes the `coreClockRate` member of ze_device_properties_t for NPU devices.", + "name": "dpuClockRateHz", + "type": "uint64_t" + }, + { + "desc": "[out] Device timestamp counter frequency, in Hz. Used to convert raw device tick counts returned by zeDeviceGetGlobalTimestamps and zeCommandListAppendWriteGlobalTimestamp into time durations.", + "name": "timestampFreqHz", + "type": "uint64_t" + }, + { + "desc": "[out] On-chip CMX SRAM size for neural network workloads, in bytes.", + "name": "nnSramSizeBytes", + "type": "uint64_t" + }, + { + "desc": "[out] Version of the NPU compiler bundled with this driver, using ZE_MAKE_VERSION. Use ZE_MAJOR_VERSION and ZE_MINOR_VERSION to extract the major and minor components.", + "name": "compilerVersion", + "type": "uint32_t" + }, + { + "desc": "[out] Maximum OpenVINO opset version supported by the bundled NPU compiler.", + "name": "maxOVOpsetVersionSupported", + "type": "uint32_t" + } + ], + "name": "ze_device_npu_properties_ext_t", + "type": "struct", + "version": "1.18" + }, "ze_device_p2p_bandwidth_exp_properties_t": { "base": "ze_base_properties_t", "class": "zeDevice", @@ -64173,7 +65940,7 @@ "type": "void*" }, { - "desc": "[out] Returns the available usable memory at the device level. This is typically less than or equal to the available physical memory on the device. It important to note that usable memory size reported is transient in nature and cannot be used to reliably guarentee success of future allocations. The usable memory includes all the memory that the clients can allocate for their use and by L0 Core for its internal allocations.", + "desc": "[out] Returns the available usable memory at the device level. This is typically less than or equal to the available physical memory on the device. It is important to note that usable memory size reported is transient in nature and cannot be used to reliably guarantee success of future allocations. The usable memory includes all the memory that the clients can allocate for their use and by L0 Core for its internal allocations.", "name": "currUsableMemSize", "type": "uint64_t" } @@ -64537,7 +66304,7 @@ "type": "const void*" }, { - "desc": "[in] device address that would be updated with atomic_add upon signaling of this event, must be device USM memory", + "desc": "[in] device address that would be updated with atomic_add upon signaling of this event, must be device USM memory.\nWhen this event is signaled from append operations that execute on more than one device, the driver performs cross-device (peer) atomic updates to this address. Not all devices support cross-device atomic operations; the user must ensure atomics are supported between the involved devices (see ZE_DEVICE_P2P_PROPERTY_FLAG_ATOMICS returned by zeDeviceGetP2PProperties, and cross-device capabilities returned by zeDeviceGetMemoryAccessProperties). Using cross-device signaling on devices that do not support cross-device atomics results in undefined behavior.\n", "name": "deviceAddress", "type": "uint64_t*" }, @@ -64871,7 +66638,8 @@ "This structure may be passed to zeMemGetAllocProperties, via the `pNext` member of ze_memory_allocation_properties_t, to export a memory allocation as a file descriptor.", "This structure may be passed to zeImageGetAllocPropertiesExt, via the `pNext` member of ze_image_allocation_ext_properties_t, to export an image as a file descriptor.", "This structure may be passed to zePhysicalMemGetProperties, via the `pNext` member of ze_physical_mem_properties_t, to export physical memory as a file descriptor.", - "The requested memory export type must have been specified when the allocation was made." + "The requested memory export type must have been specified when the allocation was made.", + "The returned `fd` is owned by the driver. The application must not close it directly." ], "members": [ { @@ -64893,7 +66661,7 @@ "type": "ze_external_memory_type_flags_t" }, { - "desc": "[out] the exported file descriptor handle representing the allocation.", + "desc": "[out] the exported file descriptor handle representing the allocation.\nOwned by the driver; must not be closed directly by the application.\n", "name": "fd", "type": "int" } @@ -65186,7 +66954,7 @@ "type": "ze_uuid_t" }, { - "desc": "[out] Description of fabric edge technology. Will be set to the string \"unkown\" if this cannot be determined for this edge", + "desc": "[out] Description of fabric edge technology. Will be set to the string \"unknown\" if this cannot be determined for this edge", "name": "model[ZE_MAX_FABRIC_EDGE_MODEL_EXP_SIZE]", "type": "char" }, @@ -65822,6 +67590,39 @@ "type": "struct", "version": "1.5" }, + "ze_init_driver_app_version_ext_desc_t": { + "base": "ze_base_desc_t", + "class": "ze", + "desc": "Declares the maximum core API version supported by the application", + "details": [ + "This structure may be passed to zeInitDrivers, via the `pNext` member of ze_init_driver_type_desc_t, to declare the maximum core API version the application was built against and is able to handle.", + "'oneAPI' Level-Zero otherwise provides no mechanism for an application to communicate the API version it supports to a driver; zeDriverGetApiVersion only reports the version supported by the driver, not the application. A driver may use the application-declared version to gate version-dependent behavior for backward compatibility, for example only reporting enumerants or memory types introduced in newer API versions to applications that understand them.", + "If this structure is not provided, the driver must assume the application supports only the baseline behavior and must not rely on any version-gated behavior being understood by the application.", + "A driver should clamp version-gated behavior to the minimum of the version it supports and the version the application declares." + ], + "members": [ + { + "desc": "[in] type of this structure", + "init": "ZE_STRUCTURE_TYPE_INIT_DRIVER_APP_VERSION_EXT_DESC", + "name": "stype", + "type": "ze_structure_type_t" + }, + { + "desc": "[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).", + "init": "nullptr", + "name": "pNext", + "type": "const void*" + }, + { + "desc": "[in] maximum core 'oneAPI' Level-Zero API version supported by the application.", + "name": "apiVersionHint", + "type": "ze_api_version_t" + } + ], + "name": "ze_init_driver_app_version_ext_desc_t", + "type": "struct", + "version": "1.18" + }, "ze_init_driver_type_desc_t": { "base": "ze_base_desc_t", "class": "ze", @@ -65919,6 +67720,53 @@ "type": "struct", "version": "1.15" }, + "ze_ipc_phys_mem_handle_range_ext_desc_t": { + "base": "ze_base_desc_t", + "class": "zeMem", + "desc": "Descriptor for capturing a VA range into an IPC memory handle.", + "details": [ + "Pass this structure via the `pNext` parameter of zeMemGetIpcHandleWithProperties. When present, the `ptr` argument specifies the base VA of the range rather than the base of a single allocation.", + "The `ptr` argument of zeMemGetIpcHandleWithProperties specifies the base VA of the range.", + "The range may span more than one reserved VA region created by zeVirtualMemReserve; the underlying reservations are not significant. What is captured is the ordered set of physical memory objects mapped along `[ptr, ptr+size)`.", + "The caller may start at an arbitrary offset within a mapped range and may capture a subset of a larger mapped range, provided the requested `[ptr, ptr+size)` is itself fully and contiguously mapped.", + "An individual physical memory object along the range need not be mapped at its own offset zero; zeVirtualMemMap may have mapped it at a non-zero offset into the physical object. The export captures the offset at which each physical object was mapped, and the importer reproduces each mapping at that same offset, so the importer views exactly the same memory as the exporter.", + "This extension is only supported for ranges backed by virtual reservations (zeVirtualMemReserve) mapped to physical memory objects (zeVirtualMemMap). Device, host, and shared USM pointers (from zeMemAllocDevice, zeMemAllocHost, and zeMemAllocShared) are not supported and will not be grouped into a range handle. If `[ptr, ptr+size)` includes any standard USM VA rather than a reserved VA, zeMemGetIpcHandleWithProperties returns ZE_RESULT_ERROR_INVALID_ARGUMENT.", + "The driver enumerates all physical memory objects mapped to `[ptr, ptr+size)` and encodes them into the returned IPC handle in VA order.", + "On the importer side, zeMemOpenIpcHandle decodes the handle and maps all physical objects into a fresh contiguous VA reservation in the same order.", + "The total addressable size on the importer equals `size`. When `ptr` begins at an offset within a physical memory object, the returned importer pointer corresponds to `ptr`, not to the base of the first encoded object.", + "The importer does not need to be told `size` out of band: the range handle is self-describing. Calling zeMemGetAddressRange on the pointer returned by zeMemOpenIpcHandle reports the base and full `size` of the imported range.", + "The exported IPC handle is a static snapshot taken at the time of the call. Physical memory subsequently mapped into, unmapped from, or grown beyond the exporter's VA range is not reflected in a previously exported handle or in any already-open importer view; a new export is required to share the additional mappings.", + "There is no application-visible limit on the number of physical memory objects a range may encode; how the driver represents and stores them is opaque and is not bound by the size of ze_ipc_mem_handle_t. If the driver cannot accommodate the range, for example it cannot store the number of physical objects being represented, zeMemGetIpcHandleWithProperties fails with ZE_RESULT_ERROR_UNSUPPORTED_SIZE.", + "Returns ZE_RESULT_ERROR_ADDRESS_NOT_FOUND if any sub-region within `[ptr, ptr+size)` is not mapped to a physical memory object. The range must be fully mapped with no holes, because the importer is guaranteed a contiguous range and unmapped gaps cannot be represented.", + "Returns ZE_RESULT_ERROR_INVALID_SIZE if `size` is 0.", + "Returns ZE_RESULT_ERROR_UNSUPPORTED_SIZE if the driver cannot accommodate the range, for example the number of physical memory objects encoded exceeds what the implementation can store.", + "Returns ZE_RESULT_ERROR_INVALID_NULL_POINTER if the `ptr` argument is NULL.", + "Returns ZE_RESULT_ERROR_INVALID_ARGUMENT if `[ptr, ptr+size)` includes a device, host, or shared USM allocation rather than reserved VA mapped to physical memory.", + "Returns ZE_RESULT_ERROR_UNSUPPORTED_FEATURE if the driver or device does not support the ZE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_NAME extension." + ], + "members": [ + { + "desc": "[in] type of this structure", + "init": "ZE_STRUCTURE_TYPE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_DESC", + "name": "stype", + "type": "ze_structure_type_t" + }, + { + "desc": "[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).", + "init": "nullptr", + "name": "pNext", + "type": "const void*" + }, + { + "desc": "[in] size in bytes of the VA range starting at the `ptr` argument of\nzeMemGetIpcHandleWithProperties; must be non-zero. The range\n[ptr, ptr+size) must be fully mapped; see the details for error behavior.\n", + "name": "size", + "type": "size_t" + } + ], + "name": "ze_ipc_phys_mem_handle_range_ext_desc_t", + "type": "struct", + "version": "1.18" + }, "ze_kernel_allocation_exp_properties_t": { "base": "ze_base_properties_t", "class": "zeKernel", @@ -66537,7 +68385,7 @@ "type": "const void*" }, { - "desc": "[in] mutable command flags.\n - must be 0 (default, equivalent to setting all flags bar kernel instruction), or a valid combination of ze_mutable_command_exp_flag_t\n - in order to include kernel instruction mutation, ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION must be explictly included\n", + "desc": "[in] mutable command flags.\n - must be 0 (default, equivalent to setting all flags bar kernel instruction), or a valid combination of ze_mutable_command_exp_flag_t\n - in order to include kernel instruction mutation, ZE_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION must be explicitly included\n", "name": "flags", "type": "ze_mutable_command_exp_flags_t" } @@ -67016,7 +68864,7 @@ "type": "void*" }, { - "desc": "[out] Required pitch Aligment in Bytes.", + "desc": "[out] Required pitch Alignment in Bytes.", "name": "pitchAlign", "type": "size_t" }, @@ -69367,7 +71215,7 @@ "desc": "Extension properties for Device State", "details": [ "This structure may be returned from zesDeviceGetState via the `pNext` member of zes_device_state_t", - "Provides extended device state information including wedged state, survivability mode, and flash override status" + "Provides extended device state information including wedged state, survivability mode, flash override status, GPU lost condition, and kernel driver binding status" ], "members": [ { @@ -69693,7 +71541,7 @@ "desc": "Provides information about the fabric link attached to a port", "members": [ { - "desc": "[out] Description of link technology. Will be set to the string \"unkown\" if this cannot be determined for this link.", + "desc": "[out] Description of link technology. Will be set to the string \"unknown\" if this cannot be determined for this link.", "name": "desc[ZES_MAX_FABRIC_LINK_TYPE_SIZE]", "type": "char" } @@ -69780,7 +71628,7 @@ "class": "zesFabricPort", "desc": "Unique identifier for a fabric port", "details": [ - "This not a universal identifier. The identified is garanteed to be unique for the current hardware configuration of the system. Changes in the hardware may result in a different identifier for a given port.", + "This is not a universal identifier. The identified is guaranteed to be unique for the current hardware configuration of the system. Changes in the hardware may result in a different identifier for a given port.", "The main purpose of this identifier to build up an instantaneous topology map of system connectivity. An application should enumerate all fabric ports and match the `remotePortId` member of zes_fabric_port_state_t to the `portId` member of zes_fabric_port_properties_t." ], "members": [ @@ -69822,7 +71670,7 @@ "type": "void*" }, { - "desc": "[out] Description of port technology. Will be set to the string \"unkown\" if this cannot be determined for this port.", + "desc": "[out] Description of port technology. Will be set to the string \"unknown\" if this cannot be determined for this port.", "name": "model[ZES_MAX_FABRIC_PORT_MODEL_SIZE]", "type": "char" }, @@ -70529,7 +72377,7 @@ "zes_mem_properties_t": { "base": "zes_base_properties_t", "class": "zesMemory", - "desc": "Memory properties", + "desc": "Memory properties. To get the memory vendor ID and memory vendor name, pNext member of this structure should point to an instance of zes_memory_vendor_info_ext_properties_t with its stype set to ZES_STRUCTURE_TYPE_MEMORY_VENDOR_INFO_EXT_PROPERTIES.", "members": [ { "desc": "[in] type of this structure", @@ -70588,7 +72436,7 @@ "class": "zesMemory", "desc": "Memory state - health, allocated", "details": [ - "Percent free is given by 100 * free / pysical mem size." + "Percent free is given by 100 * free / physical mem size." ], "members": [ { @@ -70614,7 +72462,7 @@ "type": "uint64_t" }, { - "desc": "[out] The total allocatable memory in bytes (can be less than the `physicalSize` member of zes_mem_properties_t). *DEPRECATED* \n This member can no longer track the allocatable memory reliably. Clients depending on this information can use the \n zeDeviceGetProperties with ze_device_usablemem_size_ext_properties_t extention to get information of the available usable memory.\n", + "desc": "[out] The total allocatable memory in bytes (can be less than the `physicalSize` member of zes_mem_properties_t). *DEPRECATED* \n This member can no longer track the allocatable memory reliably. Clients depending on this information can use the \n zeDeviceGetProperties with ze_device_usablemem_size_ext_properties_t extension to get information of the available usable memory.\n", "name": "size", "type": "uint64_t" } @@ -70623,6 +72471,47 @@ "type": "struct", "version": "1.0" }, + "zes_memory_vendor_info_ext_properties_t": { + "base": "zes_base_properties_t", + "class": "zesMemory", + "desc": "Memory Vendor Info Extension Properties structure", + "details": [ + "This structure can be passed as an extension structure to zesMemoryGetProperties via pNext member", + "Returns the memory vendor ID and the memory vendor name" + ], + "members": [ + { + "desc": "[in] type of this structure", + "init": "ZES_STRUCTURE_TYPE_MEMORY_VENDOR_INFO_EXT_PROPERTIES", + "name": "stype", + "type": "zes_structure_type_t" + }, + { + "desc": "[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).", + "init": "nullptr", + "name": "pNext", + "type": "void*" + }, + { + "desc": "[out] Memory vendor ID for the device. A value of 0 indicates that the memory vendor ID could not be determined.", + "name": "vendorId", + "type": "uint32_t" + }, + { + "desc": "[out] Length of the memory vendor name, excluding the null terminator. A value of 0 indicates that the memory vendor name could not be determined.", + "name": "length", + "type": "uint16_t" + }, + { + "desc": "[out] Memory vendor name for the device (NULL terminated string value).", + "name": "vendorName[ZES_MEMORY_VENDOR_NAME_EXT_SIZE]", + "type": "char" + } + ], + "name": "zes_memory_vendor_info_ext_properties_t", + "type": "struct", + "version": "1.18" + }, "zes_oc_capabilities_t": { "base": "zes_base_capability_t", "class": "zesFrequency", @@ -70755,7 +72644,7 @@ "class": "zesOverclock", "desc": "Overclock properties", "details": [ - "Information on the overclock domain type and all the contols that are part of the domain." + "Information on the overclock domain type and all the controls that are part of the domain." ], "members": [ { @@ -72697,6 +74586,12 @@ "base": "zet_base_properties_t", "class": "zetMetric", "desc": "Exported dma_buf properties queried using `pNext` of zet_metric_group_properties_t or zet_metric_properties_t", + "details": [ + "This structure must be passed via the `pNext` member of zet_metric_group_properties_t or zet_metric_properties_t", + "The implementation retains ownership of `fd` for its entire lifetime. The application must not close `fd`; it is closed by the implementation when the metric or metric group that exported it is destroyed, or when metrics are disabled on the device.", + "The application must free any allocation it imported from `fd` before destroying the exporting metric or metric group, or disabling metrics on the device. Otherwise the imported allocation outlives `fd` and any subsequent use of it is undefined.", + "`fd` refers to a shared resource. The same `fd` may be reported by repeated queries and by queries on different metric or metric group handles. The implementation performs no synchronization on `fd` or on the memory it exports; if the application uses either from more than one thread it must serialize that access itself, for example with a mutex or by confining access to a single thread." + ], "members": [ { "desc": "[in] type of this structure", @@ -72711,7 +74606,7 @@ "type": "void*" }, { - "desc": "[out] the file descriptor handle that could be used to import the memory by the host process.", + "desc": "[out] the file descriptor handle provided for importing memory by the host process.\nOwned by the implementation; must not be closed by the application.\n", "name": "fd", "type": "int" }, @@ -74496,6 +76391,12 @@ "value": "0x10016", "version": "1.17" }, + { + "desc": "$x_context_power_saving_hint_ext_desc_t", + "name": "$X_STRUCTURE_TYPE_POWER_SAVING_HINT_EXT_DESC", + "value": "0x10017", + "version": "1.18" + }, { "desc": "$x_relaxed_allocation_limits_exp_desc_t", "name": "$X_STRUCTURE_TYPE_RELAXED_ALLOCATION_LIMITS_EXP_DESC", @@ -74891,6 +76792,24 @@ "name": "$X_STRUCTURE_TYPE_RECORD_REPLAY_GRAPH_EXT_DUMP_DESC", "value": "0x00020048", "version": "1.17" + }, + { + "desc": "$x_device_npu_properties_ext_t", + "name": "$X_STRUCTURE_TYPE_DEVICE_NPU_PROPERTIES_EXT", + "value": "0x00020049", + "version": "1.18" + }, + { + "desc": "$x_init_driver_app_version_ext_desc_t", + "name": "$X_STRUCTURE_TYPE_INIT_DRIVER_APP_VERSION_EXT_DESC", + "value": "0x0002004A", + "version": "1.18" + }, + { + "desc": "$x_ipc_phys_mem_handle_range_ext_desc_t", + "name": "$X_STRUCTURE_TYPE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_DESC", + "value": "0x0002004B", + "version": "1.18" } ], "name": "$x_structure_type_t", @@ -75595,10 +77514,16 @@ "value": "$X_MAKE_VERSION( 1, 17 )", "version": "1.17" }, + { + "desc": "version 1.18", + "name": "$X_API_VERSION_1_18", + "value": "$X_MAKE_VERSION( 1, 18 )", + "version": "1.18" + }, { "desc": "latest known version", "name": "$X_API_VERSION_CURRENT", - "value": "$X_MAKE_VERSION( 1, 17 )" + "value": "$X_MAKE_VERSION( 1, 18 )" } ], "name": "$x_api_version_t", @@ -75609,7 +77534,7 @@ "desc": "Current API version as a macro", "name": "$X_API_VERSION_CURRENT_M", "type": "macro", - "value": "$X_MAKE_VERSION( 1, 17 )", + "value": "$X_MAKE_VERSION( 1, 18 )", "version": "1.10" }, { @@ -77512,12 +79437,12 @@ "desc": "Supported command queue group property flags", "etors": [ { - "desc": "Command queue group supports enqueing compute commands.", + "desc": "Command queue group supports enqueuing compute commands.", "name": "$X_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE", "value": "$X_BIT(0)" }, { - "desc": "Command queue group supports enqueing copy commands.", + "desc": "Command queue group supports enqueuing copy commands.", "name": "$X_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY", "value": "$X_BIT(1)" }, @@ -79884,7 +81809,7 @@ "desc": "Supported command queue flags", "etors": [ { - "desc": "command queue should be optimized for submission to a single device engine.\ndriver **must** disable any implicit optimizations for distributing work across multiple engines.\nthis flag should be used when applications want full control over multi-engine submission and scheduling.\nThis flag is **DEPRECATED** as flag ${X}_COMMAND_LIST_FLAG_EXPLICIT_ONLY is **DEPRECATED**.\n", + "desc": "command queue should be optimized for submission to a single device engine.\ndriver **must** disable any implicit optimizations for distributing work across multiple engines.\nthis flag should be used when applications want full control over multi-engine submission and scheduling.\nThis flag is **DEPRECATED** as flag $X_COMMAND_LIST_FLAG_EXPLICIT_ONLY is **DEPRECATED**.\n", "name": "$X_COMMAND_QUEUE_FLAG_EXPLICIT_ONLY", "value": "$X_BIT(0)" }, @@ -84427,6 +86352,12 @@ "name": "$X_EVENT_COUNTER_BASED_FLAG_GRAPH_EXTERNAL", "value": "$X_BIT(6)", "version": "1.17" + }, + { + "desc": "Extends $X_EVENT_COUNTER_BASED_FLAG_IPC with bi-directional sharing. Event opened in another process observes the latest state and can also be used for signaling.\nMust be combined with $X_EVENT_COUNTER_BASED_FLAG_IPC\n", + "name": "$X_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL", + "value": "$X_BIT(7)", + "version": "1.18" } ], "name": "$x_event_counter_based_flags_t", @@ -84624,7 +86555,7 @@ "type": "const void*" }, { - "desc": "[in] device address that would be updated with atomic_add upon signaling of this event, must be device USM memory", + "desc": "[in] device address that would be updated with atomic_add upon signaling of this event, must be device USM memory.\nWhen this event is signaled from append operations that execute on more than one device, the driver performs cross-device (peer) atomic updates to this address. Not all devices support cross-device atomic operations; the user must ensure atomics are supported between the involved devices (see $X_DEVICE_P2P_PROPERTY_FLAG_ATOMICS returned by $xDeviceGetP2PProperties, and cross-device capabilities returned by $xDeviceGetMemoryAccessProperties). Using cross-device signaling on devices that do not support cross-device atomics results in undefined behavior.\n", "name": "deviceAddress", "type": "uint64_t*" }, @@ -84790,9 +86721,6 @@ { "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] }, - { - "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] - }, { "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] }, @@ -84825,7 +86753,7 @@ }, { "$X_RESULT_ERROR_INVALID_ENUMERATION": [ - "`0x7f < desc->flags`", + "`0xff < desc->flags`", "`0x7 < desc->signal`", "`0x7 < desc->wait`" ] @@ -84835,7 +86763,13 @@ }, { "$X_RESULT_ERROR_INVALID_ARGUMENT": [ - "`completionValue` provided in `pNext` $x_event_counter_based_external_sync_allocation_desc_t or $x_event_counter_based_external_aggregate_storage_desc_t exceeds the value returned by $xDeviceGetCounterBasedEventMaxValue" + "`completionValue` provided in `pNext` $x_event_counter_based_external_sync_allocation_desc_t or $x_event_counter_based_external_aggregate_storage_desc_t exceeds the value returned by $xDeviceGetCounterBasedEventMaxValue", + "$X_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL is set without $X_EVENT_COUNTER_BASED_FLAG_IPC" + ] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [ + "$X_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL is set and the implementation does not provide bi-directional IPC sharing" ] } ], @@ -85232,6 +87166,10 @@ { "class": "$xEvent", "desc": "Gets an IPC counter based event handle that can be shared with another process.", + "details": [ + "When the event was created with $X_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL, it may be shared before it is enqueued for signaling for the first time, and the returned handle remains valid after the event state is replaced by a signal operation. It does not have to be obtained again.", + "Without that flag, a handle represents the state captured at the time of this call. A new handle must be obtained every time the state is replaced, and this function returns $X_RESULT_ERROR_INVALID_ARGUMENT for an event that has not been enqueued for signaling yet." + ], "hash": "03b4ce20d67c426b91e040491a199e90134091131860071734f1bfc372c21fc2", "name": "CounterBasedGetIpcHandle", "params": [ @@ -85310,9 +87248,12 @@ "decl": "static", "desc": "Opens an IPC event handle to retrieve from another process.", "details": [ + "IPC sharing is bi-directional when the exported event was created with $X_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL. The opened event then refers to the same synchronization point as the event in the exporting process and may be used for waiting, querying and signaling. Without that flag the opened event holds the state captured when its handle was obtained, may be used only for waiting and querying, and must be opened again every time the state is replaced in the exporting process.", + "With bi-directional sharing, the opened event remains valid after its state is replaced by a signal operation performed in either process. It does not have to be opened again, and both processes observe the latest state.", + "With bi-directional sharing, the application must keep both processes alive for as long as the opened event is used. Waiting on, querying or signaling the event after the process that produced the latest state has exited results in undefined behavior.", "The `hContext` parameter has no requirement to match the context that was used to create the event in the exporting process. Any context of the importing process may be used, including the driver's default context.", "Device association of the opened event depends on its current state at the time of the call: if the event has not yet been enqueued for signaling, no device is yet associated with it; if the event has been enqueued for signaling, it is associated with the device performing that signal operation.", - "Any device of the importing process may signal the opened event. Enqueuing a signal operation overwrites the previous tracking point.", + "With bi-directional sharing, any device of the importing process may signal the opened event. Enqueuing a signal operation overwrites the previous tracking point.", "A device may wait on the opened event only if it has P2P access to the device associated with the current tracking point. The set of devices that may wait therefore depends on the P2P capabilities relative to the signaling device." ], "hash": "f064aa5ef47d2423b1371dee8b94576cf024861c5a7c886e10abbf6db369da85", @@ -85352,9 +87293,6 @@ { "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] }, - { - "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] - }, { "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] }, @@ -85385,6 +87323,11 @@ }, { "$X_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [ + "the handle was exported by an event created with $X_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL and the implementation does not provide bi-directional IPC sharing" + ] } ], "type": "function", @@ -85548,7 +87491,8 @@ "The duration of an event created from an event pool that was created using $X_EVENT_POOL_FLAG_KERNEL_TIMESTAMP or $X_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP flags is undefined. However, for consistency and orthogonality the event will report correctly as signaled when used by other event API functionality.", "The application must ensure the command list and events were created on the same context.", "The application must **not** call this function from simultaneous threads with the same command list handle.", - "The implementation of this function should be lock-free." + "The implementation of this function should be lock-free.", + "Passing additional parameters is possible with $xCommandListAppendSignalEventWithParameters function." ], "hash": "ef0d28011f775d958ceb555be2b1461cc174bf0b645a7086af4617a238d567d1", "name": "AppendSignalEvent", @@ -85621,16 +87565,19 @@ }, { "class": "$xCommandList", - "desc": "Appends wait on event(s) on the device into a command list.", + "desc": "Appends a signal of the event from the device into a command list and allows to pass additional parameters.", "details": [ - "The application must ensure the events are accessible by the device on which the command list was created.", - "For counter-based events, the device on which the command list was created must have peer-to-peer access to the device that last signaled the event. Unlike signaling, waiting on a counter-based event does not re-associate it with another device.", + "The application must ensure the events are accessible by the device on which the command list was created. This requirement does not apply to counter-based events.", + "For counter-based events, the event may be signaled on any device, regardless of the device used to create the event. When a counter-based event is passed for signaling, it drops its previous tracking point and re-associates with the device on which the command list was created, tracking the new signaling point. No peer-to-peer access between the previously associated device and the new signaling device is required.", + "The duration of an event created from an event pool that was created using $X_EVENT_POOL_FLAG_KERNEL_TIMESTAMP or $X_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP flags is undefined. However, for consistency and orthogonality the event will report correctly as signaled when used by other event API functionality.", "The application must ensure the command list and events were created on the same context.", "The application must **not** call this function from simultaneous threads with the same command list handle.", - "The implementation of this function should be lock-free." + "The implementation of this function should be lock-free.", + "This function allows to pass additional parameters in the form of $x_base_desc_t .", + "This function acts like $xCommandListAppendSignalEvent when passing `NULL` value to `pNext`." ], - "hash": "ba8886530b42c816643a1fd9bc79e7b1599c5488c322575de5cb14cb4422e611", - "name": "AppendWaitOnEvents", + "hash": "189cbf9089a5ab76a972096944af8f98e0687a0211e1a01f1c88d02dcd8568f5", + "name": "AppendSignalEventWithParameters", "params": [ { "desc": "[in] handle of the command list", @@ -85638,89 +87585,10 @@ "type": "$x_command_list_handle_t" }, { - "desc": "[in] number of events to wait on before continuing", - "name": "numEvents", - "type": "uint32_t" - }, - { - "desc": "[in][range(0, numEvents)] handles of the events to wait on before continuing", - "name": "phEvents", - "type": "$x_event_handle_t*" - } - ], - "return_desc": "[out] ze_result_t API result", - "return_type": "ze_result_t", - "returns": [ - { - "$X_RESULT_SUCCESS": [] - }, - { - "$X_RESULT_ERROR_UNINITIALIZED": [] - }, - { - "$X_RESULT_ERROR_DEVICE_LOST": [] - }, - { - "$X_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] - }, - { - "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] - }, - { - "$X_RESULT_ERROR_INVALID_ARGUMENT": [] - }, - { - "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] - }, - { - "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] - }, - { - "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] - }, - { - "$X_RESULT_ERROR_NOT_AVAILABLE": [] - }, - { - "$X_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] - }, - { - "$X_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] - }, - { - "$X_RESULT_ERROR_UNKNOWN": [] - }, - { - "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hCommandList`" - ] - }, - { - "$X_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == phEvents`" - ] + "desc": "[in][optional] additional parameters passed to the function", + "name": "pNext", + "type": "const void *" }, - { - "$X_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT": [] - } - ], - "type": "function", - "version": "1.0" - }, - { - "analogue": [ - "clSetUserEventStatus" - ], - "class": "$xEvent", - "desc": "Signals a event from host.", - "details": [ - "The duration of an event created from an event pool that was created using $X_EVENT_POOL_FLAG_KERNEL_TIMESTAMP or $X_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP flags is undefined. However, for consistency and orthogonality the event will report correctly as signaled when used by other event API functionality.", - "The application may call this function from simultaneous threads.", - "The implementation of this function should be lock-free." - ], - "hash": "069d419381dc35e214bcc3c367f3db0a6fd811f4843e17fb2da82d90f0a1b2d3", - "name": "HostSignal", - "params": [ { "desc": "[in] handle of the event", "name": "hEvent", @@ -85748,9 +87616,6 @@ { "$X_RESULT_ERROR_INVALID_ARGUMENT": [] }, - { - "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] - }, { "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] }, @@ -85771,38 +87636,50 @@ }, { "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hCommandList`", "`nullptr == hEvent`" ] }, { "$X_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT": [] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [ + "when passed additional parameters are invalid or incompatible with the device or command list" + ] } ], "type": "function", - "version": "1.0" + "version": "1.18" }, { - "analogue": [ - "clWaitForEvents" - ], - "class": "$xEvent", - "desc": "The current host thread waits on an event to be signaled.", + "class": "$xCommandList", + "desc": "Appends wait on event(s) on the device into a command list.", "details": [ - "The application may call this function from simultaneous threads.", - "The implementation of this function should be lock-free." + "The application must ensure the events are accessible by the device on which the command list was created.", + "For counter-based events, the device on which the command list was created must have peer-to-peer access to the device that last signaled the event. Unlike signaling, waiting on a counter-based event does not re-associate it with another device.", + "The application must ensure the command list and events were created on the same context.", + "The application must **not** call this function from simultaneous threads with the same command list handle.", + "The implementation of this function should be lock-free.", + "Passing additional parameters is possible with $xCommandListAppendWaitOnEventsWithParameters function." ], - "hash": "c445c77f74f40b78d313229255edf133072db6ecbeec3b9130ee1dd0f547964a", - "name": "HostSynchronize", + "hash": "ba8886530b42c816643a1fd9bc79e7b1599c5488c322575de5cb14cb4422e611", + "name": "AppendWaitOnEvents", "params": [ { - "desc": "[in] handle of the event", - "name": "hEvent", - "type": "$x_event_handle_t" + "desc": "[in] handle of the command list", + "name": "hCommandList", + "type": "$x_command_list_handle_t" }, { - "desc": "[in] if non-zero, then indicates the maximum time (in nanoseconds) to yield before returning $X_RESULT_SUCCESS or $X_RESULT_NOT_READY;\nif zero, then operates exactly like $xEventQueryStatus;\nif `UINT64_MAX`, then function will not return until complete or device is lost.\nDue to external dependencies, timeout may be rounded to the closest value allowed by the accuracy of those dependencies.\n", - "name": "timeout", - "type": "uint64_t" + "desc": "[in] number of events to wait on before continuing", + "name": "numEvents", + "type": "uint32_t" + }, + { + "desc": "[in][range(0, numEvents)] handles of the events to wait on before continuing", + "name": "phEvents", + "type": "$x_event_handle_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -85849,39 +87726,55 @@ }, { "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hEvent`" + "`nullptr == hCommandList`" ] }, { - "$X_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT": [] + "$X_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == phEvents`" + ] }, { - "$X_RESULT_NOT_READY": [ - "timeout expired" - ] + "$X_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT": [] } ], "type": "function", "version": "1.0" }, { - "analogue": [ - "**clGetEventInfo**", - "vkGetEventStatus" - ], - "class": "$xEvent", - "desc": "Queries an event object's status on the host.", + "class": "$xCommandList", + "desc": "Appends wait on event(s) on the device into a command list and allows to pass additional parameters.", "details": [ - "The application may call this function from simultaneous threads.", - "The implementation of this function should be lock-free." + "The application must ensure the events are accessible by the device on which the command list was created.", + "For counter-based events, the device on which the command list was created must have peer-to-peer access to the device that last signaled the event. Unlike signaling, waiting on a counter-based event does not re-associate it with another device.", + "The application must ensure the command list and events were created on the same context.", + "The application must **not** call this function from simultaneous threads with the same command list handle.", + "The implementation of this function should be lock-free.", + "This function allows to pass additional parameters in the form of $x_base_desc_t .", + "This function acts like $xCommandListAppendWaitOnEvents when passing `NULL` value to `pNext`." ], - "hash": "1091660d20f5595dad7bbbf969b0a8e9238f218438ff4f2c908b93135147cfa6", - "name": "QueryStatus", + "hash": "9cbae570cbf601e01dc036b4e45d4de86a169b753b808e25dd50b9016229bc93", + "name": "AppendWaitOnEventsWithParameters", "params": [ { - "desc": "[in] handle of the event", - "name": "hEvent", - "type": "$x_event_handle_t" + "desc": "[in] handle of the command list", + "name": "hCommandList", + "type": "$x_command_list_handle_t" + }, + { + "desc": "[in][optional] additional parameters passed to the function", + "name": "pNext", + "type": "const void *" + }, + { + "desc": "[in] number of events to wait on before continuing", + "name": "numEvents", + "type": "uint32_t" + }, + { + "desc": "[in][range(0, numEvents)] handles of the events to wait on before continuing", + "name": "phEvents", + "type": "$x_event_handle_t*" } ], "return_desc": "[out] ze_result_t API result", @@ -85905,9 +87798,6 @@ { "$X_RESULT_ERROR_INVALID_ARGUMENT": [] }, - { - "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] - }, { "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] }, @@ -85928,41 +87818,40 @@ }, { "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hEvent`" + "`nullptr == hCommandList`" + ] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == phEvents`" ] }, { "$X_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT": [] }, { - "$X_RESULT_NOT_READY": [ - "not signaled" + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [ + "when passed additional parameters are invalid or incompatible with the device or command list" ] } ], "type": "function", - "version": "1.0" + "version": "1.18" }, { "analogue": [ - "vkResetEvent" + "clSetUserEventStatus" ], - "class": "$xCommandList", - "desc": "Appends a reset of an event back to not signaled state into a command list.", + "class": "$xEvent", + "desc": "Signals a event from host.", "details": [ - "The application must ensure the events are accessible by the device on which the command list was created.", - "The application must ensure the command list and events were created on the same context.", - "The application must **not** call this function from simultaneous threads with the same command list handle.", + "The duration of an event created from an event pool that was created using $X_EVENT_POOL_FLAG_KERNEL_TIMESTAMP or $X_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP flags is undefined. However, for consistency and orthogonality the event will report correctly as signaled when used by other event API functionality.", + "The application may call this function from simultaneous threads.", "The implementation of this function should be lock-free." ], - "hash": "fd917b07e15d242dc28ee8d79b2e3827e834a35da1af31c0f46d031b02255c25", - "name": "AppendEventReset", + "hash": "069d419381dc35e214bcc3c367f3db0a6fd811f4843e17fb2da82d90f0a1b2d3", + "name": "HostSignal", "params": [ - { - "desc": "[in] handle of the command list", - "name": "hCommandList", - "type": "$x_command_list_handle_t" - }, { "desc": "[in] handle of the event", "name": "hEvent", @@ -86013,7 +87902,6 @@ }, { "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hCommandList`", "`nullptr == hEvent`" ] }, @@ -86026,16 +87914,259 @@ }, { "analogue": [ - "vkResetEvent" + "clWaitForEvents" ], "class": "$xEvent", - "desc": "The current host thread resets an event back to not signaled state.", + "desc": "The current host thread waits on an event to be signaled.", "details": [ "The application may call this function from simultaneous threads.", "The implementation of this function should be lock-free." ], - "hash": "cb686654e319bb98f202bace7ac3af520e7df43764c02d371a2fea219c0693ae", - "name": "HostReset", + "hash": "c445c77f74f40b78d313229255edf133072db6ecbeec3b9130ee1dd0f547964a", + "name": "HostSynchronize", + "params": [ + { + "desc": "[in] handle of the event", + "name": "hEvent", + "type": "$x_event_handle_t" + }, + { + "desc": "[in] if non-zero, then indicates the maximum time (in nanoseconds) to yield before returning $X_RESULT_SUCCESS or $X_RESULT_NOT_READY;\nif zero, then operates exactly like $xEventQueryStatus;\nif `UINT64_MAX`, then function will not return until complete or device is lost.\nDue to external dependencies, timeout may be rounded to the closest value allowed by the accuracy of those dependencies.\n", + "name": "timeout", + "type": "uint64_t" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "$X_RESULT_SUCCESS": [] + }, + { + "$X_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "$X_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "$X_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "$X_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "$X_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "$X_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "$X_RESULT_ERROR_UNKNOWN": [] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hEvent`" + ] + }, + { + "$X_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT": [] + }, + { + "$X_RESULT_NOT_READY": [ + "timeout expired" + ] + } + ], + "type": "function", + "version": "1.0" + }, + { + "analogue": [ + "**clGetEventInfo**", + "vkGetEventStatus" + ], + "class": "$xEvent", + "desc": "Queries an event object's status on the host.", + "details": [ + "The application may call this function from simultaneous threads.", + "The implementation of this function should be lock-free." + ], + "hash": "1091660d20f5595dad7bbbf969b0a8e9238f218438ff4f2c908b93135147cfa6", + "name": "QueryStatus", + "params": [ + { + "desc": "[in] handle of the event", + "name": "hEvent", + "type": "$x_event_handle_t" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "$X_RESULT_SUCCESS": [] + }, + { + "$X_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "$X_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "$X_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "$X_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "$X_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "$X_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "$X_RESULT_ERROR_UNKNOWN": [] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hEvent`" + ] + }, + { + "$X_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT": [] + }, + { + "$X_RESULT_NOT_READY": [ + "not signaled" + ] + } + ], + "type": "function", + "version": "1.0" + }, + { + "analogue": [ + "vkResetEvent" + ], + "class": "$xCommandList", + "desc": "Appends a reset of an event back to not signaled state into a command list.", + "details": [ + "The application must ensure the events are accessible by the device on which the command list was created.", + "The application must ensure the command list and events were created on the same context.", + "The application must **not** call this function from simultaneous threads with the same command list handle.", + "The implementation of this function should be lock-free." + ], + "hash": "fd917b07e15d242dc28ee8d79b2e3827e834a35da1af31c0f46d031b02255c25", + "name": "AppendEventReset", + "params": [ + { + "desc": "[in] handle of the command list", + "name": "hCommandList", + "type": "$x_command_list_handle_t" + }, + { + "desc": "[in] handle of the event", + "name": "hEvent", + "type": "$x_event_handle_t" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "$X_RESULT_SUCCESS": [] + }, + { + "$X_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "$X_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "$X_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "$X_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "$X_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "$X_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "$X_RESULT_ERROR_UNKNOWN": [] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hCommandList`", + "`nullptr == hEvent`" + ] + }, + { + "$X_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT": [] + } + ], + "type": "function", + "version": "1.0" + }, + { + "analogue": [ + "vkResetEvent" + ], + "class": "$xEvent", + "desc": "The current host thread resets an event back to not signaled state.", + "details": [ + "The application may call this function from simultaneous threads.", + "The implementation of this function should be lock-free." + ], + "hash": "cb686654e319bb98f202bace7ac3af520e7df43764c02d371a2fea219c0693ae", + "name": "HostReset", "params": [ { "desc": "[in] handle of the event", @@ -89027,7 +91158,7 @@ "details": [ "Takes a pointer to a device memory allocation and creates an IPC memory handle for exporting it for use in another process.", "The pointer may also be a physical memory handle cast to ``void*`` (i.e. ``(void*)hPhysicalMem``); in that case, the IPC handle represents the physical memory object directly and no virtual address mapping is required in the sending process.", - "Only one physical memory object may be associated with a single IPC handle at a time; the virtual address range passed must map to exactly one physical memory object.", + "Only one physical memory object may be associated with a single IPC handle at a time; the virtual address range passed must map to exactly one physical memory object, unless a $x_ipc_phys_mem_handle_range_ext_desc_t is chained via `pNext` to capture a range spanning multiple physical memory objects into a single IPC handle.", "The application may call this function from simultaneous threads.", "The implementation of this function must be thread-safe." ], @@ -89283,6 +91414,7 @@ "details": [ "This call may be used for IPC handles previously obtained with either $xMemGetIpcHandle or with $x_external_memory_export_fd_t via $xMemGetAllocProperties or $xPhysicalMemGetProperties.\n", "Upon call, driver may release any underlying resources associated with the IPC handle.\nFor instance, it may close the file descriptor contained in the IPC handle, if such type of handle is being used by the driver.\n", + "When the IPC handle encodes multiple physical memory objects (for example, a handle representing a range of objects), the driver releases **all** of the underlying resources it holds for that handle, not just one; for instance, it closes every file descriptor the driver opened to represent the encoded objects.", "This call does not free the original allocation for which the IPC handle was created.", "This function may **not** be called from simultaneous threads with the same IPC handle.", "The implementation of this function should be lock-free." @@ -89490,6 +91622,8 @@ "desc": "Closes an IPC memory handle", "details": [ "Closes an IPC memory handle by unmapping memory that was opened in this process using $xMemOpenIpcHandle.", + "`ptr` must be the base pointer returned by $xMemOpenIpcHandle; passing an interior address is not valid.", + "This call unmaps every physical memory object that $xMemOpenIpcHandle mapped for this pointer and frees any virtual address reservation the driver created on the caller's behalf to back it. When the handle encoded a range of multiple physical objects, all of those objects are unmapped by this single call. The application never reserved this address range and must not attempt to release it with $xVirtualMemFree; this call leaves no mappings or virtual address reservation behind.", "The application must **not** call this function from simultaneous threads with the same pointer.", "The implementation of this function must be thread-safe." ], @@ -89640,7 +91774,8 @@ "This structure may be passed to $xMemGetAllocProperties, via the `pNext` member of $x_memory_allocation_properties_t, to export a memory allocation as a file descriptor.", "This structure may be passed to $xImageGetAllocPropertiesExt, via the `pNext` member of $x_image_allocation_ext_properties_t, to export an image as a file descriptor.", "This structure may be passed to $xPhysicalMemGetProperties, via the `pNext` member of $x_physical_mem_properties_t, to export physical memory as a file descriptor.", - "The requested memory export type must have been specified when the allocation was made." + "The requested memory export type must have been specified when the allocation was made.", + "The returned `fd` is owned by the driver. The application must not close it directly." ], "members": [ { @@ -89662,7 +91797,7 @@ "type": "$x_external_memory_type_flags_t" }, { - "desc": "[out] the exported file descriptor handle representing the allocation.", + "desc": "[out] the exported file descriptor handle representing the allocation.\nOwned by the driver; must not be closed directly by the application.\n", "name": "fd", "type": "int" } @@ -90963,6 +93098,82 @@ "type": "function", "version": "1.0" }, + { + "class": "$xModule", + "desc": "Retrieve the handle of the device on which the module was created.", + "details": [ + "The application may call this function from simultaneous threads." + ], + "hash": "93e8f9a3ff92becea187ca642fac7ed7042a34034b47a0d8686047caf3e904df", + "name": "GetDeviceHandle", + "params": [ + { + "desc": "[in] handle of the module", + "name": "hModule", + "type": "$x_module_handle_t" + }, + { + "desc": "[out] handle of the device the module was created for", + "name": "phDevice", + "type": "$x_device_handle_t*" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "$X_RESULT_SUCCESS": [] + }, + { + "$X_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "$X_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "$X_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "$X_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "$X_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "$X_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "$X_RESULT_ERROR_UNKNOWN": [] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hModule`" + ] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == phDevice`" + ] + } + ], + "type": "function", + "version": "1.18" + }, { "class": "$xKernel", "desc": "Supported kernel creation flags", @@ -92315,6 +94526,82 @@ "type": "function", "version": "1.0" }, + { + "class": "$xKernel", + "desc": "Retrieve the handle of the module from which the kernel was created.", + "details": [ + "The application may call this function from simultaneous threads." + ], + "hash": "2efbb433a9daec21aecb4679ed2cb8e6e0896972e7c1de9a638ff16d30573b36", + "name": "GetModuleHandle", + "params": [ + { + "desc": "[in] handle of the kernel", + "name": "hKernel", + "type": "$x_kernel_handle_t" + }, + { + "desc": "[out] handle of the module the kernel was created from", + "name": "phModule", + "type": "$x_module_handle_t*" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "$X_RESULT_SUCCESS": [] + }, + { + "$X_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "$X_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "$X_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "$X_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "$X_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "$X_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "$X_RESULT_ERROR_UNKNOWN": [] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hKernel`" + ] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == phModule`" + ] + } + ], + "type": "function", + "version": "1.18" + }, { "class": "$xCommandList", "desc": "Kernel dispatch group count.", @@ -92460,8 +94747,8 @@ "The application must ensure the command list, kernel and events were created on the same context.", "This function may **not** be called from simultaneous threads with the same command list handle.", "The implementation of this function should be lock-free.", - "This function allows to pass additional parameters in the form of `${x}_base_desc_t`", - "This function can replace $xCommandListAppendLaunchCooperativeKernel with additional parameter `${x}_command_list_append_launch_kernel_param_cooperative_desc_t`", + "This function allows to pass additional parameters in the form of $x_base_desc_t .", + "This function can replace $xCommandListAppendLaunchCooperativeKernel with additional parameter $x_command_list_append_launch_kernel_param_cooperative_desc_t .", "This function supports both immediate and regular command lists." ], "hash": "68de0f134fa51cd128beb83b3126c3eb4076d3530dd023ff9c996d4575b0d761", @@ -92607,8 +94894,8 @@ "This function may **not** be called from simultaneous threads with the same command list handle.", "The implementation of this function should be lock-free.", "This function supports both immediate and regular command lists.", - "This function changes kernel state as if separate ${x}KernelSetGroupSize and ${x}KernelSetArgumentValue functions were called.", - "This function allows to pass additional extensions in the form of `${x}_base_desc_t`" + "This function changes kernel state as if separate $xKernelSetGroupSize and $xKernelSetArgumentValue functions were called.", + "This function allows to pass additional extensions in the form of $x_base_desc_t ." ], "hash": "20d3fe433ebf999d27f9524307fe6eb57c72dac9092bf240bad4a2230e325cbb", "name": "AppendLaunchKernelWithArguments", @@ -92718,10 +95005,10 @@ ] }, { - "$X_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION - \"as per ${x}KernelSetGroupSize\"": [] + "$X_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION - as per $xKernelSetGroupSize": [] }, { - "$X_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT - \"as per ${x}KernelSetArgumentValue\"": [] + "$X_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT - as per $xKernelSetArgumentValue": [] } ], "type": "function", @@ -92957,7 +95244,7 @@ "The application must ensure the array of launch arguments and count buffer are visible to the device on which the command list was created.", "The implementation must not access the contents of the array of launch arguments or count buffer as they are free to be modified by either the Host or device up until execution.", "This may **only** be called for a command list created with command queue group ordinal that supports compute.", - "The application must enusre the command list, kernel and events were created, and the memory was allocated, on the same context.", + "The application must ensure the command list, kernel and events were created, and the memory was allocated, on the same context.", "This function may **not** be called from simultaneous threads with the same command list handle.", "The implementation of this function should be lock-free." ], @@ -96781,89 +99068,6 @@ } ] }, - { - "header": { - "desc": "Intel $OneApi Level-Zero Extension for supporting power saving hint.", - "ordinal": 10002000, - "type": "header", - "version": "1.2" - }, - "name": "powersavinghint", - "objects": [ - { - "desc": "Power Saving Hint Extension Name", - "name": "$X_CONTEXT_POWER_SAVING_HINT_EXP_NAME", - "type": "macro", - "value": "\"$X_experimental_power_saving_hint\"", - "version": "1.2" - }, - { - "desc": "Power Saving Hint Extension Version(s)", - "etors": [ - { - "desc": "version 1.0", - "name": "$X_POWER_SAVING_HINT_EXP_VERSION_1_0", - "value": "$X_MAKE_VERSION( 1, 0 )" - }, - { - "desc": "latest known version", - "name": "$X_POWER_SAVING_HINT_EXP_VERSION_CURRENT", - "value": "$X_MAKE_VERSION( 1, 0 )" - } - ], - "name": "$x_power_saving_hint_exp_version_t", - "type": "enum", - "version": "1.2" - }, - { - "class": "$xContext", - "desc": "Supported device types", - "etors": [ - { - "desc": "Minumum power savings. The device will make no attempt to save power while executing work submitted to this context.", - "name": "$X_POWER_SAVING_HINT_TYPE_MIN", - "value": "0" - }, - { - "desc": "Maximum power savings. The device will do everything to bring power to a minimum while executing work submitted to this context.", - "name": "$X_POWER_SAVING_HINT_TYPE_MAX", - "value": "100" - } - ], - "name": "$x_power_saving_hint_type_t", - "type": "enum", - "version": "1.2" - }, - { - "base": "$x_base_desc_t", - "class": "$xContext", - "desc": "Extended context descriptor containing power saving hint.", - "members": [ - { - "desc": "[in] type of this structure", - "init": "$X_STRUCTURE_TYPE_CONTEXT_POWER_SAVING_HINT_EXP_DESC", - "name": "stype", - "type": "$x_structure_type_t" - }, - { - "desc": "[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).", - "init": "nullptr", - "name": "pNext", - "type": "const void*" - }, - { - "desc": "[in] power saving hint (default value = 0). This is value from [0,100] and can use pre-defined settings from $x_power_saving_hint_type_t.\n", - "init": "0", - "name": "hint", - "type": "uint32_t" - } - ], - "name": "$x_context_power_saving_hint_exp_desc_t", - "type": "struct", - "version": "1.2" - } - ] - }, { "header": { "desc": "Intel $OneApi Level-Zero Extension APIs for Subgroups", @@ -98078,7 +100282,7 @@ "desc": "Frees allocated host memory, device memory, or shared memory on the context using the specified free policy.", "details": [ "Similar to zeMemFree, with added parameter to choose the free policy.", - "Does not gaurantee memory is freed upon return. See free policy descriptions for details.", + "Does not guarantee memory is freed upon return. See free policy descriptions for details.", "The application must **not** call this function from simultaneous threads with the same pointer.", "The implementation of this function must be thread-safe." ], @@ -98577,7 +100781,7 @@ "type": "$x_uuid_t" }, { - "desc": "[out] Description of fabric edge technology. Will be set to the string \"unkown\" if this cannot be determined for this edge", + "desc": "[out] Description of fabric edge technology. Will be set to the string \"unknown\" if this cannot be determined for this edge", "name": "model[$X_MAX_FABRIC_EDGE_MODEL_EXP_SIZE]", "type": "char" }, @@ -102283,7 +104487,7 @@ "type": "void*" }, { - "desc": "[out] Required pitch Aligment in Bytes.", + "desc": "[out] Required pitch Alignment in Bytes.", "name": "pitchAlign", "type": "size_t" }, @@ -102498,7 +104702,7 @@ "type": "size_t" }, { - "desc": "[in] user programmed slice pitch , must be multiple of rowPitch. For 2D image arrary or a slice of a 3D image array - this pitch should be >= rowPitch * image_height . For 1D iamge array >= rowPitch.\n", + "desc": "[in] user programmed slice pitch , must be multiple of rowPitch. For 2D image array or a slice of a 3D image array - this pitch should be >= rowPitch * image_height . For 1D image array >= rowPitch.\n", "name": "slicePitch", "type": "size_t" } @@ -102982,7 +105186,7 @@ "type": "const void*" }, { - "desc": "[in] mutable command flags.\n - must be 0 (default, equivalent to setting all flags bar kernel instruction), or a valid combination of $x_mutable_command_exp_flag_t\n - in order to include kernel instruction mutation, $X_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION must be explictly included\n", + "desc": "[in] mutable command flags.\n - must be 0 (default, equivalent to setting all flags bar kernel instruction), or a valid combination of $x_mutable_command_exp_flag_t\n - in order to include kernel instruction mutation, $X_MUTABLE_COMMAND_EXP_FLAG_KERNEL_INSTRUCTION must be explicitly included\n", "name": "flags", "type": "$x_mutable_command_exp_flags_t" } @@ -106282,7 +108486,7 @@ "When using the \"expected\" size for the acceleration structure buffer, the acceleration structure construction may fail with $X_RESULT_EXT_RTAS_BUILD_RETRY. If this happens, the user may resize their acceleration structure buffer using the returned `*pRtasBufferSizeBytes` value, which will be updated with an improved size estimate that will likely result in a successful build.\n", "The acceleration structure construction is run on the host and is synchronous, thus after the function returns with a successful result, the acceleration structure may be used.\n", "All provided data buffers must be host-accessible. The referenced scene data (index- and vertex- buffers) have to be accessible from the host, and will **not** be referenced by the build acceleration structure.\n", - "The acceleration structure buffer is typicall a host allocation that is later manually copied to a device allocation. Alternatively one can also use a shared USM allocation as acceration structure buffer and skip the copy.\n", + "The acceleration structure buffer is typically a host allocation that is later manually copied to a device allocation. Alternatively one can also use a shared USM allocation as acceleration structure buffer and skip the copy.\n", "A successfully constructed acceleration structure is entirely self-contained. There is no requirement for input data to persist beyond build completion.\n", "A successfully constructed acceleration structure is non-copyable.\n", "Acceleration structure construction may be parallelized by passing a valid handle to a parallel operation object and joining that parallel operation using $xRTASParallelOperationJoinExt with user-provided worker threads.\n", @@ -107425,7 +109629,7 @@ "type": "void*" }, { - "desc": "[out] Returns the available usable memory at the device level. This is typically less than or equal to the available physical memory on the device. It important to note that usable memory size reported is transient in nature and cannot be used to reliably guarentee success of future allocations. The usable memory includes all the memory that the clients can allocate for their use and by L0 Core for its internal allocations.", + "desc": "[out] Returns the available usable memory at the device level. This is typically less than or equal to the available physical memory on the device. It is important to note that usable memory size reported is transient in nature and cannot be used to reliably guarantee success of future allocations. The usable memory includes all the memory that the clients can allocate for their use and by L0 Core for its internal allocations.", "name": "currUsableMemSize", "type": "uint64_t" } @@ -107595,7 +109799,7 @@ "Takes a pointer to a device or host memory allocation and creates an IPC memory handle for exporting it for use in another process.", "The pointer must be the base pointer of a device or host memory allocation; i.e. the value returned from $xMemAllocDevice or from $xMemAllocHost, respectively or allocated from $xPhysicalMemCreate.", "The pointer may also be a virtual address that was mapped to a physical memory object via $xVirtualMemMap; in that case, the IPC handle represents the underlying physical memory object.", - "Only one physical memory object may be associated with a single IPC handle at a time; the virtual address range passed must map to exactly one physical memory object.", + "Only one physical memory object may be associated with a single IPC handle at a time; the virtual address range passed must map to exactly one physical memory object, unless a $x_ipc_phys_mem_handle_range_ext_desc_t is chained via `pNext` to capture a range spanning multiple physical memory objects into a single IPC handle.", "The application may call this function from simultaneous threads.", "The implementation of this function must be thread-safe." ], @@ -108247,12 +110451,12 @@ ] }, { - "$ZE_RESULT_ERROR_GRAPH_UNJOINED_FORKS": [ + "$X_RESULT_ERROR_GRAPH_UNJOINED_FORKS": [ "if graph contains unjoined forks" ] }, { - "$ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING": [ + "$X_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING": [ "if command list is not in graph capture mode" ] } @@ -108336,7 +110540,7 @@ ] }, { - "$ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING": [ + "$X_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING": [ "if command list is not in graph capture mode" ] } @@ -108513,7 +110717,9 @@ "Recorded regular events (not counter-based) are shared between executable graph instances; the application is responsible for avoiding data races during concurrent execution of multiple graph instances.", "Recorded internal counter-based events (i.e. without ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL) may be used only for synchronization within the graph. Their state is tied to the underlying execution queue and is not shared between executable graph instances.", "Recorded external counter-based events (i.e. with ZEX_COUNTER_BASED_EVENT_FLAG_GRAPH_EXTERNAL) may be used to synchronize the graph with device commands submitted outside the graph (for example, before or after $xCommandListAppendGraphExt) and with the host. External counter-based events may incur additional overhead compared to internal counter-based events.", - "Resources used in captured commands (e.g. buffers passed to kernels as arguments) are shared between instances; the application is responsible for avoiding data races during concurrent execution." + "Resources used in captured commands (e.g. buffers passed to kernels as arguments) are shared between instances; the application is responsible for avoiding data races during concurrent execution.", + "The function returns `ZE_RESULT_ERROR_INVALID_GRAPH` when the recorded graph is invalid, for example when it contains forks that were never joined back to the primary command list.", + "The function returns `ZE_RESULT_ERROR_INVALID_ARGUMENT` when graph capture has not been ended with ::zeCommandListEndGraphCaptureExt." ], "hash": "0f64e2a144987e229595eeed9a0c6462c877b64db727a98abbfcfed4df0ed7ae", "name": "InstantiateExt", @@ -108585,6 +110791,9 @@ "$X_RESULT_ERROR_INVALID_NULL_POINTER": [ "`nullptr == phExecutableGraph`" ] + }, + { + "$X_RESULT_ERROR_INVALID_GRAPH": [] } ], "type": "function", @@ -109081,6 +111290,209 @@ "owner": "$xGraph", "type": "class", "version": "1.0" + }, + { + "class": "$xGraph", + "desc": "Pauses recording to the specified graph. Affected immediate command lists (both primary command lists and child command lists from which graph was recording) can be reused for any purpose during this pause without affecting the paused recording.", + "hash": "a2ca840ebd88f209b9ee43ba2b75a1865732fb62b37263416a98f3171ef88f34", + "name": "PauseCaptureExt", + "params": [ + { + "desc": "[in] handle to the graph to pause capture", + "name": "hGraph", + "type": "$x_graph_handle_t" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "$X_RESULT_SUCCESS": [] + }, + { + "$X_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "$X_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "$X_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "$X_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "$X_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "$X_RESULT_ERROR_UNKNOWN": [] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hGraph`" + ] + }, + { + "$X_RESULT_ERROR_INVALID_ARGUMENT": [ + "Graph is not in a recording state" + ] + } + ], + "type": "function", + "version": "1.18" + }, + { + "class": "$xGraph", + "desc": "Resumes capturing commands to the graph after a pause.", + "hash": "d5b3f4ecc3e1a35912d01e84cac8d94434f8f7fdd585707ff72b5d38273c0c96", + "name": "ResumeCaptureExt", + "params": [ + { + "desc": "[in] handle to the graph to resume capture", + "name": "hGraph", + "type": "$x_graph_handle_t" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "$X_RESULT_SUCCESS": [] + }, + { + "$X_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "$X_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "$X_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "$X_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "$X_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "$X_RESULT_ERROR_UNKNOWN": [] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hGraph`" + ] + }, + { + "$X_RESULT_ERROR_INVALID_ARGUMENT": [ + "Graph is not in a paused state" + ] + } + ], + "type": "function", + "version": "1.18" + }, + { + "class": "$xGraph", + "desc": "Gets monotonically increasing, process-unique ID of the graph.", + "hash": "5dbd9de2403e78eaa6faecfefacdb6b06ede1a944b3bb71847b3df9b56654321", + "name": "GetIdExt", + "params": [ + { + "desc": "[in] handle to the graph", + "name": "hGraph", + "type": "$x_graph_handle_t" + }, + { + "desc": "[out] pointer to the memory where the graph ID will be written", + "name": "pGraphId", + "type": "uint64_t*" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "$X_RESULT_SUCCESS": [] + }, + { + "$X_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "$X_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "$X_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "$X_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "$X_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "$X_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "$X_RESULT_ERROR_UNKNOWN": [] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hGraph`" + ] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == pGraphId`" + ] + } + ], + "type": "function", + "version": "1.18" } ] }, @@ -109202,15 +111614,387 @@ }, { "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ - "`nullptr == hCommandList`" + "`nullptr == hCommandList`" + ] + }, + { + "$X_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT": [] + }, + { + "$X_RESULT_ERROR_INVALID_SIZE": [ + "`(nullptr == phWaitEvents) && (0 < numWaitEvents)`" + ] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [ + "an extension passed via pNext is not supported" + ] + } + ], + "type": "function", + "version": "1.17" + } + ] + }, + { + "header": { + "desc": "Intel $OneApi Level-Zero Extension APIs for Virtual Memory Read-Only Properties", + "ordinal": 10017000, + "type": "header", + "version": "1.17" + }, + "name": "virtualMemReadOnlyProperties", + "objects": [ + { + "desc": "Virtual Memory Read-Only Properties Extension Name", + "name": "$X_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_NAME", + "type": "macro", + "value": "\"$X_extension_virtual_mem_readonly_properties\"", + "version": "1.17" + }, + { + "desc": "Virtual Memory Read-Only Properties Extension Version(s)", + "etors": [ + { + "desc": "version 1.0", + "name": "$X_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_VERSION_1_0", + "value": "$X_MAKE_VERSION( 1, 0 )" + }, + { + "desc": "latest known version", + "name": "$X_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_VERSION_CURRENT", + "value": "$X_MAKE_VERSION( 1, 0 )" + } + ], + "name": "$x_virtual_mem_readonly_properties_ext_version_t", + "type": "enum", + "version": "1.17" + }, + { + "class": "$xDevice", + "desc": "Read-only memory page capability values", + "etors": [ + { + "desc": "Read-only attribute has no effect; the driver does not act on it.", + "name": "$X_DEVICE_READONLY_MEMORY_CAPABILITY_NONE", + "value": "0" + }, + { + "desc": "Read-only attribute is a performance hint to the OS; writes may still succeed without fault.", + "name": "$X_DEVICE_READONLY_MEMORY_CAPABILITY_HINT", + "value": "1" + }, + { + "desc": "Read-only attribute is hardware-enforced; writes to read-only pages will cause a device fault.", + "name": "$X_DEVICE_READONLY_MEMORY_CAPABILITY_ENFORCED", + "value": "2" + } + ], + "name": "$x_device_readonly_memory_capability_t", + "type": "enum", + "version": "1.17" + }, + { + "base": "$x_base_properties_t", + "class": "$xDevice", + "desc": "Device read-only memory capability properties", + "details": [ + "This structure may be returned from $xDeviceGetProperties via the `pNext` member of $x_device_properties_t" + ], + "members": [ + { + "desc": "[in] type of this structure", + "init": "$X_STRUCTURE_TYPE_DEVICE_READONLY_MEMORY_EXT_PROPERTIES", + "name": "stype", + "type": "$x_structure_type_t" + }, + { + "desc": "[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).", + "init": "nullptr", + "name": "pNext", + "type": "void*" + }, + { + "desc": "[out] Indicates device behavior when $X_MEMORY_ACCESS_ATTRIBUTE_READONLY is applied to a virtual memory page.\n$X_DEVICE_READONLY_MEMORY_CAPABILITY_NONE - the attribute has no effect; writes succeed normally.\n$X_DEVICE_READONLY_MEMORY_CAPABILITY_HINT - the attribute is a performance hint; writes may still succeed.\n$X_DEVICE_READONLY_MEMORY_CAPABILITY_ENFORCED - the attribute is hardware-enforced; writes cause a device fault.\n", + "name": "readonlyCapability", + "type": "$x_device_readonly_memory_capability_t" + } + ], + "name": "$x_device_readonly_memory_ext_properties_t", + "type": "struct", + "version": "1.17" + } + ] + }, + { + "header": { + "desc": "Intel $OneApi Level-Zero Extension APIs for Command Queue Set Priority", + "ordinal": 10018000, + "type": "header", + "version": "1.18" + }, + "name": "commandQueueSetPriority", + "objects": [ + { + "desc": "Command Queue Set Priority Extension Name", + "name": "$X_COMMAND_QUEUE_SET_PRIORITY_EXT_NAME", + "type": "macro", + "value": "\"$X_extension_command_queue_set_priority\"", + "version": "1.18" + }, + { + "desc": "Command Queue Set Priority Extension Version(s)", + "etors": [ + { + "desc": "version 1.0", + "name": "$X_COMMAND_QUEUE_SET_PRIORITY_EXT_VERSION_1_0", + "value": "$X_MAKE_VERSION( 1, 0 )" + }, + { + "desc": "latest known version", + "name": "$X_COMMAND_QUEUE_SET_PRIORITY_EXT_VERSION_CURRENT", + "value": "$X_MAKE_VERSION( 1, 0 )" + } + ], + "name": "$x_command_queue_set_priority_ext_version_t", + "type": "enum", + "version": "1.18" + }, + { + "class": "$xCommandQueue", + "desc": "Sets the priority of a command queue.", + "details": [ + "The application may call this function from simultaneous threads.", + "This function changes the priority of an existing command queue, overriding the priority specified at creation through $x_command_queue_desc_t; the updated value is reported by $xCommandQueueGetPriority.", + "Whether the new priority affects commands already submitted to the command queue, or only commands submitted after this call, is implementation-defined." + ], + "hash": "f40a9e20233500ed749859bd4117c760e6a2c94773b9991021428320ceee1646", + "name": "SetPriorityExt", + "params": [ + { + "desc": "[in] handle of the command queue", + "name": "hCommandQueue", + "type": "$x_command_queue_handle_t" + }, + { + "desc": "[in] priority to set for the command queue", + "name": "priority", + "type": "$x_command_queue_priority_t" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "$X_RESULT_SUCCESS": [] + }, + { + "$X_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "$X_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "$X_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "$X_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "$X_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "$X_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "$X_RESULT_ERROR_UNKNOWN": [] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hCommandQueue`" + ] + }, + { + "$X_RESULT_ERROR_INVALID_ENUMERATION": [ + "`$X_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < priority`" + ] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_ENUMERATION": [] + } + ], + "type": "function", + "version": "1.18" + } + ] + }, + { + "header": { + "desc": "Intel $OneApi Level-Zero APIs for Compiler-Info Query", + "ordinal": 10018000, + "type": "header", + "version": "1.18" + }, + "name": "compilerInfoQuery", + "objects": [ + { + "desc": "Compiler-info list selected by $xDeviceGetCompilerInfo", + "etors": [ + { + "desc": "Supported SPIR-V capabilities, as an array of uint32_t numeric capability identifiers", + "name": "$X_DEVICE_COMPILER_INFO_SPIRV_CAPABILITIES", + "value": "1" + }, + { + "desc": "Supported SPIR-V extensions, as an array of null-terminated names, each $X_MAX_EXTENSION_NAME bytes", + "name": "$X_DEVICE_COMPILER_INFO_SPIRV_EXTENSIONS", + "value": "2" + }, + { + "desc": "Supported compiler options, as a single null-terminated string of space-separated tokens", + "name": "$X_DEVICE_COMPILER_INFO_COMPILER_OPTIONS", + "value": "3" + }, + { + "desc": "Supported driver options, as a single null-terminated string of space-separated tokens", + "name": "$X_DEVICE_COMPILER_INFO_DRIVER_OPTIONS", + "value": "4" + } + ], + "name": "$x_device_compiler_info_t", + "type": "enum", + "version": "1.18" + }, + { + "class": "$xDevice", + "desc": "Name and version entry returned for the OpenCL C compiler-info lists", + "members": [ + { + "desc": "[out] packed version of the entry", + "name": "version", + "type": "uint32_t" + }, + { + "desc": "[out] null-terminated name", + "name": "name[$X_MAX_EXTENSION_NAME]", + "type": "char" + } + ], + "name": "$x_compiler_name_version_t", + "type": "struct", + "version": "1.18" + }, + { + "class": "$xDevice", + "desc": "Retrieves compiler-specific information for the device, selected by an enumerated type.", + "details": [ + "This query is scoped to compiler-specific data.", + "The paramName parameter selects data to be queried. Data layout is documented along with respective paramName enum entry.", + "The application may call this function from simultaneous threads.", + "The implementation of this function should be lock-free." + ], + "hash": "ac5fc7472ee620cc58c1f186dfb20b1d94b7af0ea9b91766989602e8fabb1633", + "name": "GetCompilerInfo", + "params": [ + { + "desc": "[in] handle of the device", + "name": "hDevice", + "type": "$x_device_handle_t" + }, + { + "desc": "[in] compiler-info to return", + "name": "paramName", + "type": "$x_device_compiler_info_t" + }, + { + "desc": "[in][optional] additional extensions passed to the function", + "init": "nullptr", + "name": "pNext", + "type": "const void*" + }, + { + "desc": "[in,out] pointer to the size in bytes of the result.\nIf size is zero, then the driver shall update the value with the total size in bytes needed.\nIf size is less than the total size needed, then the driver shall update the value with the required size and shall not write to pData.\n", + "init": "nullptr", + "name": "pSize", + "type": "size_t*" + }, + { + "desc": "[in,out][optional][range(0, *pSize)] pointer to the result buffer.\nIf pData is nullptr, then only the required size is returned in pSize.\n", + "init": "nullptr", + "name": "pData", + "type": "void*" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "$X_RESULT_SUCCESS": [] + }, + { + "$X_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "$X_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "$X_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "$X_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "$X_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "$X_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "$X_RESULT_ERROR_UNKNOWN": [] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hDevice`" ] }, { - "$X_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT": [] + "$X_RESULT_ERROR_INVALID_ENUMERATION": [ + "`$X_DEVICE_COMPILER_INFO_DRIVER_OPTIONS < paramName`" + ] }, { - "$X_RESULT_ERROR_INVALID_SIZE": [ - "`(nullptr == phWaitEvents) && (0 < numWaitEvents)`" + "$X_RESULT_ERROR_UNSUPPORTED_ENUMERATION": [] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == pSize`" ] }, { @@ -109220,79 +112004,212 @@ } ], "type": "function", - "version": "1.17" + "version": "1.18" } ] }, { "header": { - "desc": "Intel $OneApi Level-Zero Extension APIs for Virtual Memory Read-Only Properties", - "ordinal": 10017000, + "desc": "Intel $OneApi Level-Zero Extension APIs for declaring the application-supported API version at initialization", + "ordinal": 10018000, "type": "header", - "version": "1.17" + "version": "1.18" }, - "name": "virtualMemReadOnlyProperties", + "name": "initDriverAppVersion", "objects": [ { - "desc": "Virtual Memory Read-Only Properties Extension Name", - "name": "$X_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_NAME", + "desc": "Init Driver Application Version Extension Name", + "name": "$X_INIT_DRIVER_APP_VERSION_EXT_NAME", "type": "macro", - "value": "\"$X_extension_virtual_mem_readonly_properties\"", - "version": "1.17" + "value": "\"$X_extension_init_driver_app_version\"", + "version": "1.18" }, { - "desc": "Virtual Memory Read-Only Properties Extension Version(s)", + "desc": "Init Driver Application Version Extension Version(s)", "etors": [ { "desc": "version 1.0", - "name": "$X_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_VERSION_1_0", + "name": "$X_INIT_DRIVER_APP_VERSION_EXT_VERSION_1_0", "value": "$X_MAKE_VERSION( 1, 0 )" }, { "desc": "latest known version", - "name": "$X_VIRTUAL_MEM_READONLY_PROPERTIES_EXT_VERSION_CURRENT", + "name": "$X_INIT_DRIVER_APP_VERSION_EXT_VERSION_CURRENT", "value": "$X_MAKE_VERSION( 1, 0 )" } ], - "name": "$x_virtual_mem_readonly_properties_ext_version_t", + "name": "$x_init_driver_app_version_ext_version_t", "type": "enum", - "version": "1.17" + "version": "1.18" }, { - "class": "$xDevice", - "desc": "Read-only memory page capability values", + "base": "$x_base_desc_t", + "class": "$x", + "desc": "Declares the maximum core API version supported by the application", + "details": [ + "This structure may be passed to $xInitDrivers, via the `pNext` member of $x_init_driver_type_desc_t, to declare the maximum core API version the application was built against and is able to handle.", + "$OneApi Level-Zero otherwise provides no mechanism for an application to communicate the API version it supports to a driver; $xDriverGetApiVersion only reports the version supported by the driver, not the application. A driver may use the application-declared version to gate version-dependent behavior for backward compatibility, for example only reporting enumerants or memory types introduced in newer API versions to applications that understand them.", + "If this structure is not provided, the driver must assume the application supports only the baseline behavior and must not rely on any version-gated behavior being understood by the application.", + "A driver should clamp version-gated behavior to the minimum of the version it supports and the version the application declares." + ], + "members": [ + { + "desc": "[in] type of this structure", + "init": "$X_STRUCTURE_TYPE_INIT_DRIVER_APP_VERSION_EXT_DESC", + "name": "stype", + "type": "$x_structure_type_t" + }, + { + "desc": "[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).", + "init": "nullptr", + "name": "pNext", + "type": "const void*" + }, + { + "desc": "[in] maximum core $OneApi Level-Zero API version supported by the application.", + "name": "apiVersionHint", + "type": "$x_api_version_t" + } + ], + "name": "$x_init_driver_app_version_ext_desc_t", + "type": "struct", + "version": "1.18" + } + ] + }, + { + "header": { + "desc": "Intel $OneApi Level-Zero Extension for exporting a virtual address range as a single IPC memory handle.", + "ordinal": 10018000, + "type": "header", + "version": "1.18" + }, + "name": "ipcPhysMemRange", + "objects": [ + { + "desc": "IPC Physical Memory Range Extension Name", + "name": "$X_IPC_PHYS_MEM_HANDLE_RANGE_EXT_NAME", + "type": "macro", + "value": "\"$X_extension_ipc_phys_mem_handle_range\"", + "version": "1.18" + }, + { + "desc": "IPC Physical Memory Range Extension Version(s)", "etors": [ { - "desc": "Read-only attribute has no effect; the driver does not act on it.", - "name": "$X_DEVICE_READONLY_MEMORY_CAPABILITY_NONE", - "value": "0" + "desc": "version 1.0", + "name": "$X_IPC_PHYS_MEM_HANDLE_RANGE_EXT_VERSION_1_0", + "value": "$X_MAKE_VERSION( 1, 0 )" }, { - "desc": "Read-only attribute is a performance hint to the OS; writes may still succeed without fault.", - "name": "$X_DEVICE_READONLY_MEMORY_CAPABILITY_HINT", - "value": "1" + "desc": "latest known version", + "name": "$X_IPC_PHYS_MEM_HANDLE_RANGE_EXT_VERSION_CURRENT", + "value": "$X_MAKE_VERSION( 1, 0 )" + } + ], + "name": "$x_ipc_phys_mem_handle_range_ext_version_t", + "type": "enum", + "version": "1.18" + }, + { + "base": "$x_base_desc_t", + "class": "$xMem", + "desc": "Descriptor for capturing a VA range into an IPC memory handle.", + "details": [ + "Pass this structure via the `pNext` parameter of $xMemGetIpcHandleWithProperties. When present, the `ptr` argument specifies the base VA of the range rather than the base of a single allocation.", + "The `ptr` argument of $xMemGetIpcHandleWithProperties specifies the base VA of the range.", + "The range may span more than one reserved VA region created by $xVirtualMemReserve; the underlying reservations are not significant. What is captured is the ordered set of physical memory objects mapped along `[ptr, ptr+size)`.", + "The caller may start at an arbitrary offset within a mapped range and may capture a subset of a larger mapped range, provided the requested `[ptr, ptr+size)` is itself fully and contiguously mapped.", + "An individual physical memory object along the range need not be mapped at its own offset zero; $xVirtualMemMap may have mapped it at a non-zero offset into the physical object. The export captures the offset at which each physical object was mapped, and the importer reproduces each mapping at that same offset, so the importer views exactly the same memory as the exporter.", + "This extension is only supported for ranges backed by virtual reservations ($xVirtualMemReserve) mapped to physical memory objects ($xVirtualMemMap). Device, host, and shared USM pointers (from $xMemAllocDevice, $xMemAllocHost, and $xMemAllocShared) are not supported and will not be grouped into a range handle. If `[ptr, ptr+size)` includes any standard USM VA rather than a reserved VA, $xMemGetIpcHandleWithProperties returns $X_RESULT_ERROR_INVALID_ARGUMENT.", + "The driver enumerates all physical memory objects mapped to `[ptr, ptr+size)` and encodes them into the returned IPC handle in VA order.", + "On the importer side, $xMemOpenIpcHandle decodes the handle and maps all physical objects into a fresh contiguous VA reservation in the same order.", + "The total addressable size on the importer equals `size`. When `ptr` begins at an offset within a physical memory object, the returned importer pointer corresponds to `ptr`, not to the base of the first encoded object.", + "The importer does not need to be told `size` out of band: the range handle is self-describing. Calling $xMemGetAddressRange on the pointer returned by $xMemOpenIpcHandle reports the base and full `size` of the imported range.", + "The exported IPC handle is a static snapshot taken at the time of the call. Physical memory subsequently mapped into, unmapped from, or grown beyond the exporter's VA range is not reflected in a previously exported handle or in any already-open importer view; a new export is required to share the additional mappings.", + "There is no application-visible limit on the number of physical memory objects a range may encode; how the driver represents and stores them is opaque and is not bound by the size of $x_ipc_mem_handle_t. If the driver cannot accommodate the range, for example it cannot store the number of physical objects being represented, $xMemGetIpcHandleWithProperties fails with $X_RESULT_ERROR_UNSUPPORTED_SIZE.", + "Returns $X_RESULT_ERROR_ADDRESS_NOT_FOUND if any sub-region within `[ptr, ptr+size)` is not mapped to a physical memory object. The range must be fully mapped with no holes, because the importer is guaranteed a contiguous range and unmapped gaps cannot be represented.", + "Returns $X_RESULT_ERROR_INVALID_SIZE if `size` is 0.", + "Returns $X_RESULT_ERROR_UNSUPPORTED_SIZE if the driver cannot accommodate the range, for example the number of physical memory objects encoded exceeds what the implementation can store.", + "Returns $X_RESULT_ERROR_INVALID_NULL_POINTER if the `ptr` argument is NULL.", + "Returns $X_RESULT_ERROR_INVALID_ARGUMENT if `[ptr, ptr+size)` includes a device, host, or shared USM allocation rather than reserved VA mapped to physical memory.", + "Returns $X_RESULT_ERROR_UNSUPPORTED_FEATURE if the driver or device does not support the $X_IPC_PHYS_MEM_HANDLE_RANGE_EXT_NAME extension." + ], + "members": [ + { + "desc": "[in] type of this structure", + "init": "$X_STRUCTURE_TYPE_IPC_PHYS_MEM_HANDLE_RANGE_EXT_DESC", + "name": "stype", + "type": "$x_structure_type_t" }, { - "desc": "Read-only attribute is hardware-enforced; writes to read-only pages will cause a device fault.", - "name": "$X_DEVICE_READONLY_MEMORY_CAPABILITY_ENFORCED", - "value": "2" + "desc": "[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).", + "init": "nullptr", + "name": "pNext", + "type": "const void*" + }, + { + "desc": "[in] size in bytes of the VA range starting at the `ptr` argument of\n$xMemGetIpcHandleWithProperties; must be non-zero. The range\n[ptr, ptr+size) must be fully mapped; see the details for error behavior.\n", + "name": "size", + "type": "size_t" } ], - "name": "$x_device_readonly_memory_capability_t", + "name": "$x_ipc_phys_mem_handle_range_ext_desc_t", + "type": "struct", + "version": "1.18" + } + ] + }, + { + "header": { + "desc": "Intel $OneApi Level-Zero Extension APIs for NPU Device Properties", + "ordinal": 10018000, + "type": "header", + "version": "1.18" + }, + "name": "npuProperties", + "objects": [ + { + "desc": "NPU Device Properties Extension Name", + "name": "$X_DEVICE_NPU_PROPERTIES_EXT_NAME", + "type": "macro", + "value": "\"$X_extension_device_npu_properties\"", + "version": "1.18" + }, + { + "desc": "NPU Device Properties Extension Version(s)", + "etors": [ + { + "desc": "version 1.0", + "name": "$X_DEVICE_NPU_PROPERTIES_EXT_VERSION_1_0", + "value": "$X_MAKE_VERSION( 1, 0 )" + }, + { + "desc": "latest known version", + "name": "$X_DEVICE_NPU_PROPERTIES_EXT_VERSION_CURRENT", + "value": "$X_MAKE_VERSION( 1, 0 )" + } + ], + "name": "$x_device_npu_properties_ext_version_t", "type": "enum", - "version": "1.17" + "version": "1.18" }, { "base": "$x_base_properties_t", "class": "$xDevice", - "desc": "Device read-only memory capability properties", + "desc": "NPU device properties queried using $xDeviceGetProperties", "details": [ - "This structure may be returned from $xDeviceGetProperties via the `pNext` member of $x_device_properties_t" + "This structure may be returned from $xDeviceGetProperties via the `pNext` member of $x_device_properties_t.", + "Applicable only when the `type` member of $x_device_properties_t is $X_DEVICE_TYPE_VPU.", + "Exposes NPU-native topology, clock, timestamp frequency, on-chip SRAM, and compiler capability information that has no clean analogue in the GPU-oriented base $x_device_properties_t struct.", + "`compilerVersion` and `maxOVOpsetVersionSupported` describe the compiler bundled with the driver, and report identical values for every device reported by a given driver instance.", + "The base $x_device_properties_t fields remain populated on NPU devices for backward compatibility with consumers that predate this extension. New consumers should prefer the NPU-native fields exposed here.", + "Identity (`vendorId`, `deviceId`, `subdeviceId`, `uuid`, `name`), capabilities (`flags`, `maxMemAllocSize`, `maxHardwareContexts`, `maxCommandQueuePriority`), and host/global timestamp validity (`timestampValidBits`) continue to be sourced from the base $x_device_properties_t struct. NPU does not implement kernel timestamp APIs; `kernelTimestampValidBits` is 0 on NPU devices." ], "members": [ { "desc": "[in] type of this structure", - "init": "$X_STRUCTURE_TYPE_DEVICE_READONLY_MEMORY_EXT_PROPERTIES", + "init": "$X_STRUCTURE_TYPE_DEVICE_NPU_PROPERTIES_EXT", "name": "stype", "type": "$x_structure_type_t" }, @@ -109303,14 +112220,224 @@ "type": "void*" }, { - "desc": "[out] Indicates device behavior when $X_MEMORY_ACCESS_ATTRIBUTE_READONLY is applied to a virtual memory page.\n$X_DEVICE_READONLY_MEMORY_CAPABILITY_NONE - the attribute has no effect; writes succeed normally.\n$X_DEVICE_READONLY_MEMORY_CAPABILITY_HINT - the attribute is a performance hint; writes may still succeed.\n$X_DEVICE_READONLY_MEMORY_CAPABILITY_ENFORCED - the attribute is hardware-enforced; writes cause a device fault.\n", - "name": "readonlyCapability", - "type": "$x_device_readonly_memory_capability_t" + "desc": "[out] Total number of NCE tiles enabled on the device. Equivalent to popcount(tileEnableMask). Supersedes the `numSlices` member of $x_device_properties_t for NPU devices.", + "name": "tileCount", + "type": "uint32_t" + }, + { + "desc": "[out] Bitmask of enabled NCE tiles. popcount(tileEnableMask) == tileCount.", + "name": "tileEnableMask", + "type": "uint32_t" + }, + { + "desc": "[out] Total number of SHAVE (VLIW) vector processors across all tiles. Supersedes the `numEUsPerSubslice` member of $x_device_properties_t for NPU devices.", + "name": "totalShaveCount", + "type": "uint32_t" + }, + { + "desc": "[out] Multiply-accumulate (MAC) units per tile at INT8 x INT8 precision (baseline). Throughput at other precisions: 2x for INT8 x INT4, 0.5x for FP16 x FP16, 0.5x for INT16 x INT8, 1x for INT16 x INT4. Supersedes half the `physicalEUSimdWidth` member of $x_device_properties_t for NPU devices.", + "name": "int8x8MacsPerTile", + "type": "uint32_t" + }, + { + "desc": "[out] Total DPU MAC units across the device. Derived as tileCount * int8x8MacsPerTile.", + "name": "totalDpuMacs", + "type": "uint32_t" + }, + { + "desc": "[out] Number of compute engines on the device.", + "name": "numComputeEngines", + "type": "uint32_t" + }, + { + "desc": "[out] Number of copy (DMA) engines on the device.", + "name": "numCopyEngines", + "type": "uint32_t" + }, + { + "desc": "[out] DPU compute clock rate, in Hz. Supersedes the `coreClockRate` member of $x_device_properties_t for NPU devices.", + "name": "dpuClockRateHz", + "type": "uint64_t" + }, + { + "desc": "[out] Device timestamp counter frequency, in Hz. Used to convert raw device tick counts returned by $xDeviceGetGlobalTimestamps and $xCommandListAppendWriteGlobalTimestamp into time durations.", + "name": "timestampFreqHz", + "type": "uint64_t" + }, + { + "desc": "[out] On-chip CMX SRAM size for neural network workloads, in bytes.", + "name": "nnSramSizeBytes", + "type": "uint64_t" + }, + { + "desc": "[out] Version of the NPU compiler bundled with this driver, using $X_MAKE_VERSION. Use $X_MAJOR_VERSION and $X_MINOR_VERSION to extract the major and minor components.", + "name": "compilerVersion", + "type": "uint32_t" + }, + { + "desc": "[out] Maximum OpenVINO opset version supported by the bundled NPU compiler.", + "name": "maxOVOpsetVersionSupported", + "type": "uint32_t" } ], - "name": "$x_device_readonly_memory_ext_properties_t", + "name": "$x_device_npu_properties_ext_t", "type": "struct", - "version": "1.17" + "version": "1.18" + } + ] + }, + { + "header": { + "desc": "Intel $OneApi Level-Zero Extension for supporting power saving hint.", + "ordinal": 10018000, + "type": "header", + "version": "1.18" + }, + "name": "powersavinghint", + "objects": [ + { + "desc": "Power Saving Hint Extension Name", + "name": "$X_CONTEXT_POWER_SAVING_HINT_EXT_NAME", + "type": "macro", + "value": "\"$X_extension_power_saving_hint\"", + "version": "1.18" + }, + { + "desc": "Power Saving Hint Extension Version(s)", + "etors": [ + { + "desc": "version 1.0", + "name": "$X_POWER_SAVING_HINT_EXT_VERSION_1_0", + "value": "$X_MAKE_VERSION( 1, 0 )" + }, + { + "desc": "latest known version", + "name": "$X_POWER_SAVING_HINT_EXT_VERSION_CURRENT", + "value": "$X_MAKE_VERSION( 1, 0 )" + } + ], + "name": "$x_power_saving_hint_ext_version_t", + "type": "enum", + "version": "1.18" + }, + { + "class": "$xContext", + "desc": "Supported device types", + "etors": [ + { + "desc": "Minimum power savings. The device will make no attempt to save power while executing work submitted to this context.", + "name": "$X_POWER_SAVING_HINT_EXT_TYPE_MIN", + "value": "0" + }, + { + "desc": "Maximum power savings. The device will do everything to bring power to a minimum while executing work submitted to this context.", + "name": "$X_POWER_SAVING_HINT_EXT_TYPE_MAX", + "value": "100" + } + ], + "name": "$x_power_saving_hint_ext_type_t", + "type": "enum", + "version": "1.18" + }, + { + "base": "$x_base_desc_t", + "class": "$xContext", + "desc": "Extended context descriptor containing power saving hint.", + "members": [ + { + "desc": "[in] type of this structure", + "init": "$X_STRUCTURE_TYPE_CONTEXT_POWER_SAVING_HINT_EXT_DESC", + "name": "stype", + "type": "$x_structure_type_t" + }, + { + "desc": "[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).", + "init": "nullptr", + "name": "pNext", + "type": "const void*" + }, + { + "desc": "[in] power saving hint (default value = 0). This is value from [0,100] and can use pre-defined settings from $x_power_saving_hint_ext_type_t.\n", + "init": "0", + "name": "hint", + "type": "uint32_t" + } + ], + "name": "$x_context_power_saving_hint_ext_desc_t", + "type": "struct", + "version": "1.18" + }, + { + "desc": "Power Saving Hint Extension Name. @deprecated since 1.18: Use $X_CONTEXT_POWER_SAVING_HINT_EXT_NAME instead.", + "name": "$X_CONTEXT_POWER_SAVING_HINT_EXP_NAME", + "type": "macro", + "value": "\"$X_experimental_power_saving_hint\"", + "version": "1.2" + }, + { + "desc": "Power Saving Hint Extension Version(s). @deprecated since 1.18: Use $x_context_power_saving_hint_ext_desc_t instead.", + "etors": [ + { + "desc": "version 1.0", + "name": "$X_POWER_SAVING_HINT_EXP_VERSION_1_0", + "value": "$X_MAKE_VERSION( 1, 0 )" + }, + { + "desc": "latest known version", + "name": "$X_POWER_SAVING_HINT_EXP_VERSION_CURRENT", + "value": "$X_MAKE_VERSION( 1, 0 )" + } + ], + "name": "$x_power_saving_hint_exp_version_t", + "type": "enum", + "version": "1.2" + }, + { + "class": "$xContext", + "desc": "Supported device types. @deprecated since 1.18: Use $x_power_saving_hint_ext_type_t instead.", + "etors": [ + { + "desc": "Minimum power savings. The device will make no attempt to save power while executing work submitted to this context.", + "name": "$X_POWER_SAVING_HINT_TYPE_MIN", + "value": "0" + }, + { + "desc": "Maximum power savings. The device will do everything to bring power to a minimum while executing work submitted to this context.", + "name": "$X_POWER_SAVING_HINT_TYPE_MAX", + "value": "100" + } + ], + "name": "$x_power_saving_hint_type_t", + "type": "enum", + "version": "1.2" + }, + { + "base": "$x_base_desc_t", + "class": "$xContext", + "desc": "Extended context descriptor containing power saving hint. @deprecated since 1.18: Use $x_context_power_saving_hint_ext_desc_t instead.", + "members": [ + { + "desc": "[in] type of this structure", + "init": "$X_STRUCTURE_TYPE_CONTEXT_POWER_SAVING_HINT_EXP_DESC", + "name": "stype", + "type": "$x_structure_type_t" + }, + { + "desc": "[in][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).", + "init": "nullptr", + "name": "pNext", + "type": "const void*" + }, + { + "desc": "[in] power saving hint (default value = 0). This is value from [0,100] and can use pre-defined settings from $x_power_saving_hint_type_t.\n", + "init": "0", + "name": "hint", + "type": "uint32_t" + } + ], + "name": "$x_context_power_saving_hint_exp_desc_t", + "type": "struct", + "version": "1.2" } ] } @@ -111244,7 +114371,7 @@ }, { "$X_RESULT_ERROR_INVALID_ARGUMENT": [ - "the thread argument specifies more than one or a non-existant thread" + "the thread argument specifies more than one or a non-existent thread" ] } ], @@ -113519,7 +116646,7 @@ "objects": [ { "class": "$tKernel", - "desc": "Supportted profile features", + "desc": "Supported profile features", "etors": [ { "desc": "request the compiler attempt to minimize register usage as much as possible to allow for instrumentation", @@ -117490,6 +120617,12 @@ "base": "$t_base_properties_t", "class": "$tMetric", "desc": "Exported dma_buf properties queried using `pNext` of $t_metric_group_properties_t or $t_metric_properties_t", + "details": [ + "This structure must be passed via the `pNext` member of $t_metric_group_properties_t or $t_metric_properties_t", + "The implementation retains ownership of `fd` for its entire lifetime. The application must not close `fd`; it is closed by the implementation when the metric or metric group that exported it is destroyed, or when metrics are disabled on the device.", + "The application must free any allocation it imported from `fd` before destroying the exporting metric or metric group, or disabling metrics on the device. Otherwise the imported allocation outlives `fd` and any subsequent use of it is undefined.", + "`fd` refers to a shared resource. The same `fd` may be reported by repeated queries and by queries on different metric or metric group handles. The implementation performs no synchronization on `fd` or on the memory it exports; if the application uses either from more than one thread it must serialize that access itself, for example with a mutex or by confining access to a single thread." + ], "members": [ { "desc": "[in] type of this structure", @@ -117504,7 +120637,7 @@ "type": "void*" }, { - "desc": "[out] the file descriptor handle that could be used to import the memory by the host process.", + "desc": "[out] the file descriptor handle provided for importing memory by the host process.\nOwned by the implementation; must not be closed by the application.\n", "name": "fd", "type": "int" }, @@ -118336,6 +121469,12 @@ "name": "$S_STRUCTURE_TYPE_DEVICE_EXT_STATE", "value": "0x00020018", "version": "1.17" + }, + { + "desc": "$s_memory_vendor_info_ext_properties_t", + "name": "$S_STRUCTURE_TYPE_MEMORY_VENDOR_INFO_EXT_PROPERTIES", + "value": "0x00020019", + "version": "1.18" } ], "name": "$s_structure_type_t", @@ -118453,9 +121592,22 @@ "desc": "Supported sysman initialization flags", "etors": [ { - "desc": "placeholder for future use", - "name": "$S_INIT_FLAG_PLACEHOLDER", - "value": "$X_BIT(0)" + "desc": "Initialize sysman for GPU devices only", + "name": "$S_INIT_FLAG_GPU_ONLY", + "value": "$X_BIT(0)", + "version": "1.18" + }, + { + "desc": "Initialize sysman for VPU devices only", + "name": "$S_INIT_FLAG_VPU_ONLY", + "value": "$X_BIT(1)", + "version": "1.18" + }, + { + "desc": "Allows $sInit() to succeed when no devices are discovered. Device discovery is deferred until the first call to $sDeviceGet(), in case no devices can be discovered when $sInit() is called.", + "name": "$S_INIT_FLAG_NO_DEVICES", + "value": "$X_BIT(2)", + "version": "1.18" } ], "name": "$s_init_flags_t", @@ -118482,7 +121634,7 @@ "ordinal": "0", "params": [ { - "desc": "[in] initialization flags.\ncurrently unused, must be 0 (default).\n", + "desc": "[in] initialization flags. This should be 0 or a combination of $s_init_flags_t values.\n", "init": "0", "name": "flags", "type": "$s_init_flags_t" @@ -118529,7 +121681,7 @@ }, { "$X_RESULT_ERROR_INVALID_ENUMERATION": [ - "`0x1 < flags`" + "`0x7 < flags`" ] }, { @@ -120644,7 +123796,7 @@ }, { "class": "$sOverclock", - "desc": "Overclock V-F curve programing.", + "desc": "Overclock V-F curve programming.", "etors": [ { "desc": "Can program an arbitrary number of V-F points up to the maximum number and each point can have arbitrary voltage and frequency values within the min/max/step limits", @@ -120714,7 +123866,7 @@ "class": "$sOverclock", "desc": "Overclock properties", "details": [ - "Information on the overclock domain type and all the contols that are part of the domain." + "Information on the overclock domain type and all the controls that are part of the domain." ], "members": [ { @@ -121977,7 +125129,7 @@ "type": "$s_overclock_handle_t" }, { - "desc": "[in] Voltage or Freqency point to read.", + "desc": "[in] Voltage or Frequency point to read.", "name": "VFType", "type": "$s_vf_type_t" }, @@ -122080,7 +125232,7 @@ "type": "$s_overclock_handle_t" }, { - "desc": "[in] Voltage or Freqency point to read.", + "desc": "[in] Voltage or Frequency point to read.", "name": "VFType", "type": "$s_vf_type_t" }, @@ -124012,7 +127164,7 @@ "class": "$sFabricPort", "desc": "Unique identifier for a fabric port", "details": [ - "This not a universal identifier. The identified is garanteed to be unique for the current hardware configuration of the system. Changes in the hardware may result in a different identifier for a given port.", + "This is not a universal identifier. The identified is guaranteed to be unique for the current hardware configuration of the system. Changes in the hardware may result in a different identifier for a given port.", "The main purpose of this identifier to build up an instantaneous topology map of system connectivity. An application should enumerate all fabric ports and match the `remotePortId` member of $s_fabric_port_state_t to the `portId` member of $s_fabric_port_properties_t." ], "members": [ @@ -124073,7 +127225,7 @@ "type": "void*" }, { - "desc": "[out] Description of port technology. Will be set to the string \"unkown\" if this cannot be determined for this port.", + "desc": "[out] Description of port technology. Will be set to the string \"unknown\" if this cannot be determined for this port.", "name": "model[$S_MAX_FABRIC_PORT_MODEL_SIZE]", "type": "char" }, @@ -124112,7 +127264,7 @@ "desc": "Provides information about the fabric link attached to a port", "members": [ { - "desc": "[out] Description of link technology. Will be set to the string \"unkown\" if this cannot be determined for this link.", + "desc": "[out] Description of link technology. Will be set to the string \"unknown\" if this cannot be determined for this link.", "name": "desc[$S_MAX_FABRIC_LINK_TYPE_SIZE]", "type": "char" } @@ -128905,7 +132057,7 @@ { "base": "$s_base_properties_t", "class": "$sMemory", - "desc": "Memory properties", + "desc": "Memory properties. To get the memory vendor ID and memory vendor name, pNext member of this structure should point to an instance of $s_memory_vendor_info_ext_properties_t with its stype set to $S_STRUCTURE_TYPE_MEMORY_VENDOR_INFO_EXT_PROPERTIES.", "members": [ { "desc": "[in] type of this structure", @@ -128964,7 +132116,7 @@ "class": "$sMemory", "desc": "Memory state - health, allocated", "details": [ - "Percent free is given by 100 * free / pysical mem size." + "Percent free is given by 100 * free / physical mem size." ], "members": [ { @@ -128990,7 +132142,7 @@ "type": "uint64_t" }, { - "desc": "[out] The total allocatable memory in bytes (can be less than the `physicalSize` member of $s_mem_properties_t). *DEPRECATED* \n This member can no longer track the allocatable memory reliably. Clients depending on this information can use the \n zeDeviceGetProperties with ze_device_usablemem_size_ext_properties_t extention to get information of the available usable memory.\n", + "desc": "[out] The total allocatable memory in bytes (can be less than the `physicalSize` member of $s_mem_properties_t). *DEPRECATED* \n This member can no longer track the allocatable memory reliably. Clients depending on this information can use the \n zeDeviceGetProperties with ze_device_usablemem_size_ext_properties_t extension to get information of the available usable memory.\n", "name": "size", "type": "uint64_t" } @@ -130735,7 +133887,8 @@ "details": [ "The application may call this function from simultaneous threads.", "The implementation of this function should be lock-free.", - "This function returns the different power usage values associated with the power domain." + "This function returns the different power usage values associated with the power domain.", + "Computing the average power usage may cause this API to wait and return only after the average power is computed over an interval. Applications that do not need it should pass `nullptr` for `pAveragePower` to reduce the time taken by this function." ], "hash": "b756db7d937321fb7259dfb67be48953e0e2db635647a7610f8770b2d025598e", "name": "GetUsage", @@ -130746,12 +133899,12 @@ "type": "$s_pwr_handle_t" }, { - "desc": "[out] Returns the instant power usage in milliwatts.", + "desc": "[out][optional] Returns the instant power usage in milliwatts. If this is `nullptr`, the instant power usage will not be returned.", "name": "pInstantPower", "type": "uint32_t*" }, { - "desc": "[out] Returns the average power usage in milliwatts.", + "desc": "[out][optional] Returns the average power usage in milliwatts. If this is `nullptr`, the average power usage will not be returned.", "name": "pAveragePower", "type": "uint32_t*" } @@ -130777,15 +133930,9 @@ { "$X_RESULT_ERROR_INVALID_ARGUMENT": [] }, - { - "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] - }, { "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] }, - { - "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] - }, { "$X_RESULT_ERROR_NOT_AVAILABLE": [] }, @@ -130805,8 +133952,17 @@ }, { "$X_RESULT_ERROR_INVALID_NULL_POINTER": [ - "`nullptr == pInstantPower`", - "`nullptr == pAveragePower`" + "`(nullptr == pInstantPower) && (nullptr == pAveragePower)`" + ] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [ + "The requested power usage value is not supported on this power domain." + ] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [ + "User does not have permissions to request this feature." ] } ], @@ -132408,7 +135564,7 @@ "type": "$s_sched_handle_t" }, { - "desc": "[in] The properties to use when configurating this mode.", + "desc": "[in] The properties to use when configuring this mode.", "name": "pProperties", "type": "$s_sched_timeout_properties_t*" }, @@ -132496,7 +135652,7 @@ "type": "$s_sched_handle_t" }, { - "desc": "[in] The properties to use when configurating this mode.", + "desc": "[in] The properties to use when configuring this mode.", "name": "pProperties", "type": "$s_sched_timeslice_properties_t*" }, @@ -133234,6 +136390,12 @@ "name": "$S_TEMP_SENSORS_VOLTAGE_REGULATOR", "value": "8", "version": "1.10" + }, + { + "desc": "The normalized temperature across the SOC, Memory and Voltage Regulators at which shutdown will occur", + "name": "$S_TEMP_SENSORS_COMPOSITE", + "value": "9", + "version": "1.18" } ], "name": "$s_temp_sensors_t", @@ -137352,6 +140514,18 @@ "desc": "The device has flash override enabled", "name": "$S_DEVICE_STATE_EXT_FLAG_FLASH_OVERRIDE", "value": "$X_BIT(3)" + }, + { + "desc": "The GPU has fallen off the pci bus or is otherwise inaccessible", + "name": "$S_DEVICE_STATE_EXT_FLAG_GPU_LOST", + "value": "$X_BIT(4)", + "version": "1.18" + }, + { + "desc": "No kernel driver is bound to the device", + "name": "$S_DEVICE_STATE_EXT_FLAG_DRIVER_NOT_LOADED", + "value": "$X_BIT(5)", + "version": "1.18" } ], "name": "$s_device_state_ext_flags_t", @@ -137364,7 +140538,7 @@ "desc": "Extension properties for Device State", "details": [ "This structure may be returned from $sDeviceGetState via the `pNext` member of $s_device_state_t", - "Provides extended device state information including wedged state, survivability mode, and flash override status" + "Provides extended device state information including wedged state, survivability mode, flash override status, GPU lost condition, and kernel driver binding status" ], "members": [ { @@ -137470,6 +140644,330 @@ "version": "1.17" } ] + }, + { + "header": { + "desc": "Intel $OneApi Level-Zero Sysman Extension APIs for Device Health Status", + "ordinal": 10018000, + "type": "header", + "version": "1.18" + }, + "name": "deviceHealth", + "objects": [ + { + "desc": "Device Health Extension Name", + "name": "$S_DEVICE_HEALTH_EXT_NAME", + "type": "macro", + "value": "\"$S_extension_device_health\"", + "version": "1.18" + }, + { + "desc": "Device Health Extension Version(s)", + "etors": [ + { + "desc": "version 1.0", + "name": "$S_DEVICE_HEALTH_EXT_VERSION_1_0", + "value": "$X_MAKE_VERSION( 1, 0 )", + "version": "1.18" + }, + { + "desc": "latest known version", + "name": "$S_DEVICE_HEALTH_EXT_VERSION_CURRENT", + "value": "$X_MAKE_VERSION( 1, 0 )" + } + ], + "name": "$s_device_health_ext_version_t", + "type": "enum", + "version": "1.18" + }, + { + "class": "$sDevice", + "desc": "Device health status", + "details": [ + "Device health represents a comprehensive assessment of a device's reliability and expected performance in upcoming operations.", + "The health indicator is stored in non-volatile memory (NVM) and persists across resets and firmware updates." + ], + "etors": [ + { + "desc": "Device is healthy with no known issues", + "name": "$S_DEVICE_HEALTH_STATUS_EXT_OK", + "value": "0", + "version": "1.18" + }, + { + "desc": "Device may have issues, diagnostics recommended", + "name": "$S_DEVICE_HEALTH_STATUS_EXT_WARNING", + "value": "1", + "version": "1.18" + }, + { + "desc": "Device should not be used until maintenance is performed", + "name": "$S_DEVICE_HEALTH_STATUS_EXT_CRITICAL", + "value": "2", + "version": "1.18" + }, + { + "desc": "Permanent non-recoverable failure; FRU replacement required", + "name": "$S_DEVICE_HEALTH_STATUS_EXT_FAILED", + "value": "3", + "version": "1.18" + } + ], + "name": "$s_device_health_status_ext_t", + "type": "enum", + "version": "1.18" + }, + { + "class": "$sDevice", + "desc": "Get device health status", + "details": [ + "This function retrieves the current health status of the device.", + "The health status is stored in non-volatile memory and persists across resets and updates.", + "The health indicator serves purely as telemetry without downstream functional effects.", + "The application may call this function from simultaneous threads.", + "The implementation of this function should be lock-free." + ], + "hash": "f7520c8ecea8a10bcdcf8e5326f1b66c0f7085637503505abbc500b19c99679f", + "name": "GetHealthStatusExt", + "params": [ + { + "desc": "[in] Sysman handle of the device.", + "name": "hDevice", + "type": "$s_device_handle_t" + }, + { + "desc": "[out] Current health status of the device.", + "name": "pHealth", + "type": "$s_device_health_status_ext_t*" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "$X_RESULT_SUCCESS": [] + }, + { + "$X_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "$X_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "$X_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [] + }, + { + "$X_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "$X_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "$X_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "$X_RESULT_ERROR_UNKNOWN": [] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hDevice`" + ] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_POINTER": [ + "`nullptr == pHealth`" + ] + } + ], + "type": "function", + "version": "1.18" + }, + { + "class": "$sDevice", + "desc": "Set device health status", + "details": [ + "This function sets the health status of the device.", + "The health status is persisted to non-volatile memory.", + "Setting health status requires appropriate permissions.", + "The application should not call this function from simultaneous threads.", + "The implementation of this function should be lock-free." + ], + "hash": "e9efbf4a0ba8157a8156d77b9e9185d6510fe8b7ec3aa3019f3d0d1538590a0b", + "name": "SetHealthStatusExt", + "params": [ + { + "desc": "[in] Sysman handle of the device.", + "name": "hDevice", + "type": "$s_device_handle_t" + }, + { + "desc": "[in] New health status to be set for the device.", + "name": "health", + "type": "$s_device_health_status_ext_t" + } + ], + "return_desc": "[out] ze_result_t API result", + "return_type": "ze_result_t", + "returns": [ + { + "$X_RESULT_SUCCESS": [] + }, + { + "$X_RESULT_ERROR_UNINITIALIZED": [] + }, + { + "$X_RESULT_ERROR_DEVICE_LOST": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_HOST_MEMORY": [] + }, + { + "$X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY": [] + }, + { + "$X_RESULT_ERROR_INVALID_ARGUMENT": [] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_FEATURE": [] + }, + { + "$X_RESULT_ERROR_DEPENDENCY_UNAVAILABLE": [] + }, + { + "$X_RESULT_ERROR_NOT_AVAILABLE": [] + }, + { + "$X_RESULT_ERROR_DEVICE_REQUIRES_RESET": [] + }, + { + "$X_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE": [] + }, + { + "$X_RESULT_ERROR_UNKNOWN": [] + }, + { + "$X_RESULT_ERROR_INVALID_NULL_HANDLE": [ + "`nullptr == hDevice`" + ] + }, + { + "$X_RESULT_ERROR_INVALID_ENUMERATION": [ + "`$S_DEVICE_HEALTH_STATUS_EXT_FAILED < health`" + ] + }, + { + "$X_RESULT_ERROR_UNSUPPORTED_ENUMERATION": [] + }, + { + "$X_RESULT_ERROR_INSUFFICIENT_PERMISSIONS": [ + "User does not have permissions to set health status." + ] + } + ], + "type": "function", + "version": "1.18" + } + ] + }, + { + "header": { + "desc": "Intel $OneApi Level-Zero Sysman Extension APIs for Memory Vendor Info", + "ordinal": 10018000, + "type": "header", + "version": "1.18" + }, + "name": "memoryVendorInfo", + "objects": [ + { + "desc": "Memory Vendor Info Extension Name", + "name": "$S_MEMORY_VENDOR_INFO_EXT_NAME", + "type": "macro", + "value": "\"$XS_extension_memory_vendor_info\"", + "version": "1.18" + }, + { + "desc": "Memory Vendor Info Extension Version(s)", + "etors": [ + { + "desc": "version 1.0", + "name": "$S_MEMORY_VENDOR_INFO_EXT_VERSION_1_0", + "value": "$X_MAKE_VERSION( 1, 0 )", + "version": "1.18" + }, + { + "desc": "latest known version", + "name": "$S_MEMORY_VENDOR_INFO_EXT_VERSION_CURRENT", + "value": "$X_MAKE_VERSION( 1, 0 )" + } + ], + "name": "$s_memory_vendor_info_ext_version_t", + "type": "enum", + "version": "1.18" + }, + { + "desc": "Maximum memory vendor name string size", + "name": "$S_MEMORY_VENDOR_NAME_EXT_SIZE", + "type": "macro", + "value": "256", + "version": "1.18" + }, + { + "base": "$s_base_properties_t", + "class": "$sMemory", + "desc": "Memory Vendor Info Extension Properties structure", + "details": [ + "This structure can be passed as an extension structure to $sMemoryGetProperties via pNext member", + "Returns the memory vendor ID and the memory vendor name" + ], + "members": [ + { + "desc": "[in] type of this structure", + "init": "$S_STRUCTURE_TYPE_MEMORY_VENDOR_INFO_EXT_PROPERTIES", + "name": "stype", + "type": "$s_structure_type_t" + }, + { + "desc": "[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).", + "init": "nullptr", + "name": "pNext", + "type": "void*" + }, + { + "desc": "[out] Memory vendor ID for the device. A value of 0 indicates that the memory vendor ID could not be determined.", + "name": "vendorId", + "type": "uint32_t" + }, + { + "desc": "[out] Length of the memory vendor name, excluding the null terminator. A value of 0 indicates that the memory vendor name could not be determined.", + "name": "length", + "type": "uint16_t" + }, + { + "desc": "[out] Memory vendor name for the device (NULL terminated string value).", + "name": "vendorName[$S_MEMORY_VENDOR_NAME_EXT_SIZE]", + "type": "char" + } + ], + "name": "$s_memory_vendor_info_ext_properties_t", + "type": "struct", + "version": "1.18" + } + ] } ], [ diff --git a/scripts/spec_metadata/spec_metadata.json b/scripts/spec_metadata/spec_metadata.json index 50556ff4..e2f960f7 100644 --- a/scripts/spec_metadata/spec_metadata.json +++ b/scripts/spec_metadata/spec_metadata.json @@ -6,12 +6,12 @@ "that scripts/templates/*.mako owns. Refresh both files together whenever the spec", "is updated -- see scripts/spec_metadata.py refresh." ], - "api_version": "1.17", - "generated_by": "scripts/spec_metadata.py refresh --spec-repo --ref v1.17.24 --ver 1.17", + "api_version": "1.18", + "generated_by": "scripts/spec_metadata.py refresh --spec-repo --ref v1.18.31 --ver 1.18", "input_json": "input.json", - "input_json_sha256": "815ca311644da513995dfd2621c102dc3210af5151f95f416f755a9ac1649a29", - "spec_commit": "60c28d2051071fdd484a72306c43fa0519a515b0", + "input_json_sha256": "362afb68aa26900f39e51c473180df0ea7ddb21a0f71a769bab5d69f2f1f5869", + "spec_commit": "5f9a99c2f7c9662b82378cbe57309f1fd477d790", "spec_repository": "https://github.com/oneapi-src/level-zero-spec", - "spec_revision": "1.17.24", - "spec_tag": "v1.17.24" + "spec_revision": "1.18.31", + "spec_tag": "v1.18.31" } diff --git a/source/drivers/null/ze_nullddi.cpp b/source/drivers/null/ze_nullddi.cpp index 35e1a668..8c98bc4a 100644 --- a/source/drivers/null/ze_nullddi.cpp +++ b/source/drivers/null/ze_nullddi.cpp @@ -2745,6 +2745,34 @@ namespace driver return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendSignalEventWithParameters + __zedlllocal ze_result_t ZE_APICALL + zeCommandListAppendSignalEventWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + ze_event_handle_t hEvent ///< [in] handle of the event + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // if the driver has created a custom function, then call it instead of using the generic path + auto pfnAppendSignalEventWithParameters = context.zeDdiTable.CommandList.pfnAppendSignalEventWithParameters; + if( nullptr != pfnAppendSignalEventWithParameters ) + { + result = pfnAppendSignalEventWithParameters( hCommandList, pNext, hEvent ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeCommandListAppendSignalEventWithParameters", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListAppendWaitOnEvents __zedlllocal ze_result_t ZE_APICALL @@ -2774,6 +2802,36 @@ namespace driver return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendWaitOnEventsWithParameters + __zedlllocal ze_result_t ZE_APICALL + zeCommandListAppendWaitOnEventsWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + uint32_t numEvents, ///< [in] number of events to wait on before continuing + ze_event_handle_t* phEvents ///< [in][range(0, numEvents)] handles of the events to wait on before + ///< continuing + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // if the driver has created a custom function, then call it instead of using the generic path + auto pfnAppendWaitOnEventsWithParameters = context.zeDdiTable.CommandList.pfnAppendWaitOnEventsWithParameters; + if( nullptr != pfnAppendWaitOnEventsWithParameters ) + { + result = pfnAppendWaitOnEventsWithParameters( hCommandList, pNext, numEvents, phEvents ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeCommandListAppendWaitOnEventsWithParameters", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeEventHostSignal __zedlllocal ze_result_t ZE_APICALL @@ -4058,6 +4116,35 @@ namespace driver return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeModuleGetDeviceHandle + __zedlllocal ze_result_t ZE_APICALL + zeModuleGetDeviceHandle( + ze_module_handle_t hModule, ///< [in] handle of the module + ze_device_handle_t* phDevice ///< [out] handle of the device the module was created for + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // if the driver has created a custom function, then call it instead of using the generic path + auto pfnGetDeviceHandle = context.zeDdiTable.Module.pfnGetDeviceHandle; + if( nullptr != pfnGetDeviceHandle ) + { + result = pfnGetDeviceHandle( hModule, phDevice ); + } + else + { + // generic implementation + *phDevice = reinterpret_cast( context.get() ); + + } + + char *env_str = context.setenv_var_with_driver_id("zeModuleGetDeviceHandle", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeKernelCreate __zedlllocal ze_result_t ZE_APICALL @@ -4438,6 +4525,35 @@ namespace driver return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeKernelGetModuleHandle + __zedlllocal ze_result_t ZE_APICALL + zeKernelGetModuleHandle( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel + ze_module_handle_t* phModule ///< [out] handle of the module the kernel was created from + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // if the driver has created a custom function, then call it instead of using the generic path + auto pfnGetModuleHandle = context.zeDdiTable.Kernel.pfnGetModuleHandle; + if( nullptr != pfnGetModuleHandle ) + { + result = pfnGetModuleHandle( hKernel, phModule ); + } + else + { + // generic implementation + *phModule = reinterpret_cast( context.get() ); + + } + + char *env_str = context.setenv_var_with_driver_id("zeKernelGetModuleHandle", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListAppendLaunchKernel __zedlllocal ze_result_t ZE_APICALL @@ -7467,6 +7583,85 @@ namespace driver return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphPauseCaptureExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphPauseCaptureExt( + ze_graph_handle_t hGraph ///< [in] handle to the graph to pause capture + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // if the driver has created a custom function, then call it instead of using the generic path + auto pfnPauseCaptureExt = context.zeDdiTable.Graph.pfnPauseCaptureExt; + if( nullptr != pfnPauseCaptureExt ) + { + result = pfnPauseCaptureExt( hGraph ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeGraphPauseCaptureExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphResumeCaptureExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphResumeCaptureExt( + ze_graph_handle_t hGraph ///< [in] handle to the graph to resume capture + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // if the driver has created a custom function, then call it instead of using the generic path + auto pfnResumeCaptureExt = context.zeDdiTable.Graph.pfnResumeCaptureExt; + if( nullptr != pfnResumeCaptureExt ) + { + result = pfnResumeCaptureExt( hGraph ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeGraphResumeCaptureExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphGetIdExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphGetIdExt( + ze_graph_handle_t hGraph, ///< [in] handle to the graph + uint64_t* pGraphId ///< [out] pointer to the memory where the graph ID will be written + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // if the driver has created a custom function, then call it instead of using the generic path + auto pfnGetIdExt = context.zeDdiTable.Graph.pfnGetIdExt; + if( nullptr != pfnGetIdExt ) + { + result = pfnGetIdExt( hGraph, pGraphId ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeGraphGetIdExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListAppendHostFunction __zedlllocal ze_result_t ZE_APICALL @@ -7503,6 +7698,68 @@ namespace driver return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueSetPriorityExt + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueSetPriorityExt( + ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t priority ///< [in] priority to set for the command queue + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // if the driver has created a custom function, then call it instead of using the generic path + auto pfnSetPriorityExt = context.zeDdiTable.CommandQueue.pfnSetPriorityExt; + if( nullptr != pfnSetPriorityExt ) + { + result = pfnSetPriorityExt( hCommandQueue, priority ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeCommandQueueSetPriorityExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetCompilerInfo + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetCompilerInfo( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_device_compiler_info_t paramName, ///< [in] compiler-info to return + const void* pNext, ///< [in][optional] additional extensions passed to the function + size_t* pSize, ///< [in,out] pointer to the size in bytes of the result. + ///< If size is zero, then the driver shall update the value with the total + ///< size in bytes needed. + ///< If size is less than the total size needed, then the driver shall + ///< update the value with the required size and shall not write to pData. + void* pData ///< [in,out][optional][range(0, *pSize)] pointer to the result buffer. + ///< If pData is nullptr, then only the required size is returned in pSize. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // if the driver has created a custom function, then call it instead of using the generic path + auto pfnGetCompilerInfo = context.zeDdiTable.Device.pfnGetCompilerInfo; + if( nullptr != pfnGetCompilerInfo ) + { + result = pfnGetCompilerInfo( hDevice, paramName, pNext, pSize, pData ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zeDeviceGetCompilerInfo", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + } // namespace driver #if defined(__cplusplus) @@ -7922,6 +8179,10 @@ zeGetDeviceProcAddrTable( pDdiTable->pfnGetCounterBasedEventMaxValue = driver::zeDeviceGetCounterBasedEventMaxValue; } + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnGetCompilerInfo = driver::zeDeviceGetCompilerInfo; + } + if (version >= ZE_API_VERSION_1_2) { pDdiTable->pfnReserveCacheExt = driver::zeDeviceReserveCacheExt; } @@ -8081,6 +8342,10 @@ zeGetCommandQueueProcAddrTable( pDdiTable->pfnGetPriority = driver::zeCommandQueueGetPriority; } + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnSetPriorityExt = driver::zeCommandQueueSetPriorityExt; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetOrdinal = driver::zeCommandQueueGetOrdinal; } @@ -8290,6 +8555,14 @@ zeGetCommandListProcAddrTable( pDdiTable->pfnAppendHostFunction = driver::zeCommandListAppendHostFunction; } + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnAppendSignalEventWithParameters = driver::zeCommandListAppendSignalEventWithParameters; + } + + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnAppendWaitOnEventsWithParameters = driver::zeCommandListAppendWaitOnEventsWithParameters; + } + if (version >= ZE_API_VERSION_1_3) { pDdiTable->pfnAppendImageCopyToMemoryExt = driver::zeCommandListAppendImageCopyToMemoryExt; } @@ -8762,6 +9035,10 @@ zeGetKernelProcAddrTable( pDdiTable->pfnGetName = driver::zeKernelGetName; } + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnGetModuleHandle = driver::zeKernelGetModuleHandle; + } + return result; } @@ -8978,6 +9255,10 @@ zeGetModuleProcAddrTable( pDdiTable->pfnGetFunctionPointer = driver::zeModuleGetFunctionPointer; } + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnGetDeviceHandle = driver::zeModuleGetDeviceHandle; + } + if (version >= ZE_API_VERSION_1_3) { pDdiTable->pfnInspectLinkageExt = driver::zeModuleInspectLinkageExt; } @@ -9302,6 +9583,18 @@ zeGetGraphProcAddrTable( pDdiTable->pfnDestroyExt = driver::zeGraphDestroyExt; } + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnPauseCaptureExt = driver::zeGraphPauseCaptureExt; + } + + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnResumeCaptureExt = driver::zeGraphResumeCaptureExt; + } + + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnGetIdExt = driver::zeGraphGetIdExt; + } + return result; } diff --git a/source/drivers/null/zes_nullddi.cpp b/source/drivers/null/zes_nullddi.cpp index d1359e8f..cfdb9fdb 100644 --- a/source/drivers/null/zes_nullddi.cpp +++ b/source/drivers/null/zes_nullddi.cpp @@ -16,8 +16,8 @@ namespace driver /// @brief Intercept function for zesInit __zedlllocal ze_result_t ZE_APICALL zesInit( - zes_init_flags_t flags ///< [in] initialization flags. - ///< currently unused, must be 0 (default). + zes_init_flags_t flags ///< [in] initialization flags. This should be 0 or a combination of + ///< ::zes_init_flags_t values. ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -3124,8 +3124,10 @@ namespace driver __zedlllocal ze_result_t ZE_APICALL zesPowerGetUsage( zes_pwr_handle_t hPower, ///< [in] Handle of the power domain. - uint32_t* pInstantPower, ///< [out] Returns the instant power usage in milliwatts. - uint32_t* pAveragePower ///< [out] Returns the average power usage in milliwatts. + uint32_t* pInstantPower, ///< [out][optional] Returns the instant power usage in milliwatts. If this + ///< is `nullptr`, the instant power usage will not be returned. + uint32_t* pAveragePower ///< [out][optional] Returns the average power usage in milliwatts. If this + ///< is `nullptr`, the average power usage will not be returned. ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -4790,6 +4792,60 @@ namespace driver return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceGetHealthStatusExt + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGetHealthStatusExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_health_status_ext_t* pHealth ///< [out] Current health status of the device. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // if the driver has created a custom function, then call it instead of using the generic path + auto pfnGetHealthStatusExt = context.zesDdiTable.Device.pfnGetHealthStatusExt; + if( nullptr != pfnGetHealthStatusExt ) + { + result = pfnGetHealthStatusExt( hDevice, pHealth ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zesDeviceGetHealthStatusExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceSetHealthStatusExt + __zedlllocal ze_result_t ZE_APICALL + zesDeviceSetHealthStatusExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_health_status_ext_t health ///< [in] New health status to be set for the device. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // if the driver has created a custom function, then call it instead of using the generic path + auto pfnSetHealthStatusExt = context.zesDdiTable.Device.pfnSetHealthStatusExt; + if( nullptr != pfnSetHealthStatusExt ) + { + result = pfnSetHealthStatusExt( hDevice, health ); + } + else + { + // generic implementation + } + + char *env_str = context.setenv_var_with_driver_id("zesDeviceSetHealthStatusExt", ZEL_NULL_DRIVER_ID); + context.env_vars.push_back(env_str); + + return result; + } + } // namespace driver #if defined(__cplusplus) @@ -4951,6 +5007,14 @@ zesGetDeviceProcAddrTable( pDdiTable->pfnPciLinkSpeedUpdateExt = driver::zesDevicePciLinkSpeedUpdateExt; } + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnGetHealthStatusExt = driver::zesDeviceGetHealthStatusExt; + } + + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnSetHealthStatusExt = driver::zesDeviceSetHealthStatusExt; + } + if (version >= ZE_API_VERSION_1_4) { pDdiTable->pfnEccAvailable = driver::zesDeviceEccAvailable; } diff --git a/source/layers/tracing/ze_tracing_cb_structs.h b/source/layers/tracing/ze_tracing_cb_structs.h index d5331aac..50bc8907 100644 --- a/source/layers/tracing/ze_tracing_cb_structs.h +++ b/source/layers/tracing/ze_tracing_cb_structs.h @@ -99,6 +99,7 @@ typedef struct _zel_ze_device_callbacks_t ze_pfnDeviceGetRuntimeRequirementsKeyCb_t pfnGetRuntimeRequirementsKeyCb; ze_pfnDeviceValidateRuntimeRequirementsCb_t pfnValidateRuntimeRequirementsCb; ze_pfnDeviceGetCounterBasedEventMaxValueCb_t pfnGetCounterBasedEventMaxValueCb; + ze_pfnDeviceGetCompilerInfoCb_t pfnGetCompilerInfoCb; ze_pfnDeviceReserveCacheExtCb_t pfnReserveCacheExtCb; ze_pfnDeviceSetCacheAdviceExtCb_t pfnSetCacheAdviceExtCb; ze_pfnDevicePciGetPropertiesExtCb_t pfnPciGetPropertiesExtCb; @@ -132,6 +133,7 @@ typedef struct _zel_ze_command_queue_callbacks_t ze_pfnCommandQueueGetFlagsCb_t pfnGetFlagsCb; ze_pfnCommandQueueGetModeCb_t pfnGetModeCb; ze_pfnCommandQueueGetPriorityCb_t pfnGetPriorityCb; + ze_pfnCommandQueueSetPriorityExtCb_t pfnSetPriorityExtCb; ze_pfnCommandQueueGetOrdinalCb_t pfnGetOrdinalCb; ze_pfnCommandQueueGetIndexCb_t pfnGetIndexCb; } zel_ze_command_queue_callbacks_t; @@ -187,6 +189,8 @@ typedef struct _zel_ze_command_list_callbacks_t ze_pfnCommandListGetGraphExtCb_t pfnGetGraphExtCb; ze_pfnCommandListAppendGraphExtCb_t pfnAppendGraphExtCb; ze_pfnCommandListAppendHostFunctionCb_t pfnAppendHostFunctionCb; + ze_pfnCommandListAppendSignalEventWithParametersCb_t pfnAppendSignalEventWithParametersCb; + ze_pfnCommandListAppendWaitOnEventsWithParametersCb_t pfnAppendWaitOnEventsWithParametersCb; ze_pfnCommandListAppendImageCopyToMemoryExtCb_t pfnAppendImageCopyToMemoryExtCb; ze_pfnCommandListAppendImageCopyFromMemoryExtCb_t pfnAppendImageCopyFromMemoryExtCb; ze_pfnCommandListHostSynchronizeCb_t pfnHostSynchronizeCb; @@ -285,6 +289,7 @@ typedef struct _zel_ze_kernel_callbacks_t ze_pfnKernelSetGlobalOffsetExpCb_t pfnSetGlobalOffsetExpCb; ze_pfnKernelGetBinaryExpCb_t pfnGetBinaryExpCb; ze_pfnKernelGetAllocationPropertiesExpCb_t pfnGetAllocationPropertiesExpCb; + ze_pfnKernelGetModuleHandleCb_t pfnGetModuleHandleCb; ze_pfnKernelSchedulingHintExpCb_t pfnSchedulingHintExpCb; } zel_ze_kernel_callbacks_t; @@ -323,6 +328,7 @@ typedef struct _zel_ze_module_callbacks_t ze_pfnModuleGetKernelNamesCb_t pfnGetKernelNamesCb; ze_pfnModuleGetPropertiesCb_t pfnGetPropertiesCb; ze_pfnModuleGetFunctionPointerCb_t pfnGetFunctionPointerCb; + ze_pfnModuleGetDeviceHandleCb_t pfnGetDeviceHandleCb; ze_pfnModuleInspectLinkageExtCb_t pfnInspectLinkageExtCb; } zel_ze_module_callbacks_t; @@ -402,6 +408,9 @@ typedef struct _zel_ze_graph_callbacks_t ze_pfnGraphIsEmptyExtCb_t pfnIsEmptyExtCb; ze_pfnGraphDumpContentsExtCb_t pfnDumpContentsExtCb; ze_pfnGraphDestroyExtCb_t pfnDestroyExtCb; + ze_pfnGraphPauseCaptureExtCb_t pfnPauseCaptureExtCb; + ze_pfnGraphResumeCaptureExtCb_t pfnResumeCaptureExtCb; + ze_pfnGraphGetIdExtCb_t pfnGetIdExtCb; } zel_ze_graph_callbacks_t; /////////////////////////////////////////////////////////////////////////////// diff --git a/source/layers/tracing/ze_tracing_register_cb.cpp b/source/layers/tracing/ze_tracing_register_cb.cpp index 9ac38900..0ffe3db6 100644 --- a/source/layers/tracing/ze_tracing_register_cb.cpp +++ b/source/layers/tracing/ze_tracing_register_cb.cpp @@ -1459,6 +1459,22 @@ zelTracerCommandListAppendSignalEventRegisterCallback( } +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerCommandListAppendSignalEventWithParametersRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListAppendSignalEventWithParametersCb_t pfnAppendSignalEventWithParametersCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.CommandList.pfnAppendSignalEventWithParametersCb = pfnAppendSignalEventWithParametersCb; + + return result; +} + + ZE_DLLEXPORT ze_result_t ZE_APICALL zelTracerCommandListAppendWaitOnEventsRegisterCallback( zel_tracer_handle_t hTracer, @@ -1475,6 +1491,22 @@ zelTracerCommandListAppendWaitOnEventsRegisterCallback( } +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerCommandListAppendWaitOnEventsWithParametersRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListAppendWaitOnEventsWithParametersCb_t pfnAppendWaitOnEventsWithParametersCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.CommandList.pfnAppendWaitOnEventsWithParametersCb = pfnAppendWaitOnEventsWithParametersCb; + + return result; +} + + ZE_DLLEXPORT ze_result_t ZE_APICALL zelTracerEventHostSignalRegisterCallback( zel_tracer_handle_t hTracer, @@ -2179,6 +2211,22 @@ zelTracerModuleGetPropertiesRegisterCallback( } +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerModuleGetDeviceHandleRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnModuleGetDeviceHandleCb_t pfnGetDeviceHandleCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.Module.pfnGetDeviceHandleCb = pfnGetDeviceHandleCb; + + return result; +} + + ZE_DLLEXPORT ze_result_t ZE_APICALL zelTracerKernelCreateRegisterCallback( zel_tracer_handle_t hTracer, @@ -2387,6 +2435,22 @@ zelTracerKernelGetNameRegisterCallback( } +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerKernelGetModuleHandleRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnKernelGetModuleHandleCb_t pfnGetModuleHandleCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.Kernel.pfnGetModuleHandleCb = pfnGetModuleHandleCb; + + return result; +} + + ZE_DLLEXPORT ze_result_t ZE_APICALL zelTracerCommandListAppendLaunchKernelRegisterCallback( zel_tracer_handle_t hTracer, @@ -3971,6 +4035,54 @@ zelTracerGraphDestroyExtRegisterCallback( } +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerGraphPauseCaptureExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphPauseCaptureExtCb_t pfnPauseCaptureExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.Graph.pfnPauseCaptureExtCb = pfnPauseCaptureExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerGraphResumeCaptureExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphResumeCaptureExtCb_t pfnResumeCaptureExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.Graph.pfnResumeCaptureExtCb = pfnResumeCaptureExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerGraphGetIdExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphGetIdExtCb_t pfnGetIdExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.Graph.pfnGetIdExtCb = pfnGetIdExtCb; + + return result; +} + + ZE_DLLEXPORT ze_result_t ZE_APICALL zelTracerCommandListAppendHostFunctionRegisterCallback( zel_tracer_handle_t hTracer, @@ -3987,5 +4099,37 @@ zelTracerCommandListAppendHostFunctionRegisterCallback( } +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerCommandQueueSetPriorityExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandQueueSetPriorityExtCb_t pfnSetPriorityExtCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.CommandQueue.pfnSetPriorityExtCb = pfnSetPriorityExtCb; + + return result; +} + + +ZE_DLLEXPORT ze_result_t ZE_APICALL +zelTracerDeviceGetCompilerInfoRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDeviceGetCompilerInfoCb_t pfnGetCompilerInfoCb + ) { + + ze_result_t result; + auto& cbs = tracing_layer::APITracer::fromHandle(hTracer)->getZeProEpilogues(callback_type, result); + if (result == ZE_RESULT_SUCCESS) + cbs.Device.pfnGetCompilerInfoCb = pfnGetCompilerInfoCb; + + return result; +} + + } //extern C \ No newline at end of file diff --git a/source/layers/tracing/ze_trcddi.cpp b/source/layers/tracing/ze_trcddi.cpp index cdaa5e2b..dea98176 100644 --- a/source/layers/tracing/ze_trcddi.cpp +++ b/source/layers/tracing/ze_trcddi.cpp @@ -3584,6 +3584,44 @@ namespace tracing_layer *tracerParams.phEvent); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendSignalEventWithParameters + __zedlllocal ze_result_t ZE_APICALL + zeCommandListAppendSignalEventWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + ze_event_handle_t hEvent ///< [in] handle of the event + ) + { + auto pfnAppendSignalEventWithParameters = context.zeDdiTable.CommandList.pfnAppendSignalEventWithParameters; + + if( nullptr == pfnAppendSignalEventWithParameters) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnAppendSignalEventWithParameters, hCommandList, pNext, hEvent); + + // capture parameters + ze_command_list_append_signal_event_with_parameters_params_t tracerParams = { + &hCommandList, + &pNext, + &hEvent + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListAppendSignalEventWithParametersCb_t, CommandList, pfnAppendSignalEventWithParametersCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnAppendSignalEventWithParameters, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phCommandList, + *tracerParams.ppNext, + *tracerParams.phEvent); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListAppendWaitOnEvents __zedlllocal ze_result_t ZE_APICALL @@ -3623,6 +3661,48 @@ namespace tracing_layer *tracerParams.pphEvents); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendWaitOnEventsWithParameters + __zedlllocal ze_result_t ZE_APICALL + zeCommandListAppendWaitOnEventsWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + uint32_t numEvents, ///< [in] number of events to wait on before continuing + ze_event_handle_t* phEvents ///< [in][range(0, numEvents)] handles of the events to wait on before + ///< continuing + ) + { + auto pfnAppendWaitOnEventsWithParameters = context.zeDdiTable.CommandList.pfnAppendWaitOnEventsWithParameters; + + if( nullptr == pfnAppendWaitOnEventsWithParameters) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandList.pfnAppendWaitOnEventsWithParameters, hCommandList, pNext, numEvents, phEvents); + + // capture parameters + ze_command_list_append_wait_on_events_with_parameters_params_t tracerParams = { + &hCommandList, + &pNext, + &numEvents, + &phEvents + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandListAppendWaitOnEventsWithParametersCb_t, CommandList, pfnAppendWaitOnEventsWithParametersCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandList.pfnAppendWaitOnEventsWithParameters, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phCommandList, + *tracerParams.ppNext, + *tracerParams.pnumEvents, + *tracerParams.pphEvents); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeEventHostSignal __zedlllocal ze_result_t ZE_APICALL @@ -5315,6 +5395,41 @@ namespace tracing_layer *tracerParams.ppModuleProperties); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeModuleGetDeviceHandle + __zedlllocal ze_result_t ZE_APICALL + zeModuleGetDeviceHandle( + ze_module_handle_t hModule, ///< [in] handle of the module + ze_device_handle_t* phDevice ///< [out] handle of the device the module was created for + ) + { + auto pfnGetDeviceHandle = context.zeDdiTable.Module.pfnGetDeviceHandle; + + if( nullptr == pfnGetDeviceHandle) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Module.pfnGetDeviceHandle, hModule, phDevice); + + // capture parameters + ze_module_get_device_handle_params_t tracerParams = { + &hModule, + &phDevice + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnModuleGetDeviceHandleCb_t, Module, pfnGetDeviceHandleCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Module.pfnGetDeviceHandle, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phModule, + *tracerParams.pphDevice); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeKernelCreate __zedlllocal ze_result_t ZE_APICALL @@ -5820,6 +5935,41 @@ namespace tracing_layer *tracerParams.ppName); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeKernelGetModuleHandle + __zedlllocal ze_result_t ZE_APICALL + zeKernelGetModuleHandle( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel + ze_module_handle_t* phModule ///< [out] handle of the module the kernel was created from + ) + { + auto pfnGetModuleHandle = context.zeDdiTable.Kernel.pfnGetModuleHandle; + + if( nullptr == pfnGetModuleHandle) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Kernel.pfnGetModuleHandle, hKernel, phModule); + + // capture parameters + ze_kernel_get_module_handle_params_t tracerParams = { + &hKernel, + &phModule + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnKernelGetModuleHandleCb_t, Kernel, pfnGetModuleHandleCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Kernel.pfnGetModuleHandle, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phKernel, + *tracerParams.pphModule); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListAppendLaunchKernel __zedlllocal ze_result_t ZE_APICALL @@ -9898,6 +10048,105 @@ namespace tracing_layer *tracerParams.phGraph); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphPauseCaptureExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphPauseCaptureExt( + ze_graph_handle_t hGraph ///< [in] handle to the graph to pause capture + ) + { + auto pfnPauseCaptureExt = context.zeDdiTable.Graph.pfnPauseCaptureExt; + + if( nullptr == pfnPauseCaptureExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnPauseCaptureExt, hGraph); + + // capture parameters + ze_graph_pause_capture_ext_params_t tracerParams = { + &hGraph + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphPauseCaptureExtCb_t, Graph, pfnPauseCaptureExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnPauseCaptureExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phGraph); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphResumeCaptureExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphResumeCaptureExt( + ze_graph_handle_t hGraph ///< [in] handle to the graph to resume capture + ) + { + auto pfnResumeCaptureExt = context.zeDdiTable.Graph.pfnResumeCaptureExt; + + if( nullptr == pfnResumeCaptureExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnResumeCaptureExt, hGraph); + + // capture parameters + ze_graph_resume_capture_ext_params_t tracerParams = { + &hGraph + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphResumeCaptureExtCb_t, Graph, pfnResumeCaptureExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnResumeCaptureExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phGraph); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphGetIdExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphGetIdExt( + ze_graph_handle_t hGraph, ///< [in] handle to the graph + uint64_t* pGraphId ///< [out] pointer to the memory where the graph ID will be written + ) + { + auto pfnGetIdExt = context.zeDdiTable.Graph.pfnGetIdExt; + + if( nullptr == pfnGetIdExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Graph.pfnGetIdExt, hGraph, pGraphId); + + // capture parameters + ze_graph_get_id_ext_params_t tracerParams = { + &hGraph, + &pGraphId + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnGraphGetIdExtCb_t, Graph, pfnGetIdExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Graph.pfnGetIdExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phGraph, + *tracerParams.ppGraphId); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListAppendHostFunction __zedlllocal ze_result_t ZE_APICALL @@ -9952,6 +10201,90 @@ namespace tracing_layer *tracerParams.pphWaitEvents); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueSetPriorityExt + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueSetPriorityExt( + ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t priority ///< [in] priority to set for the command queue + ) + { + auto pfnSetPriorityExt = context.zeDdiTable.CommandQueue.pfnSetPriorityExt; + + if( nullptr == pfnSetPriorityExt) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.CommandQueue.pfnSetPriorityExt, hCommandQueue, priority); + + // capture parameters + ze_command_queue_set_priority_ext_params_t tracerParams = { + &hCommandQueue, + &priority + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnCommandQueueSetPriorityExtCb_t, CommandQueue, pfnSetPriorityExtCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.CommandQueue.pfnSetPriorityExt, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phCommandQueue, + *tracerParams.ppriority); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetCompilerInfo + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetCompilerInfo( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_device_compiler_info_t paramName, ///< [in] compiler-info to return + const void* pNext, ///< [in][optional] additional extensions passed to the function + size_t* pSize, ///< [in,out] pointer to the size in bytes of the result. + ///< If size is zero, then the driver shall update the value with the total + ///< size in bytes needed. + ///< If size is less than the total size needed, then the driver shall + ///< update the value with the required size and shall not write to pData. + void* pData ///< [in,out][optional][range(0, *pSize)] pointer to the result buffer. + ///< If pData is nullptr, then only the required size is returned in pSize. + ) + { + auto pfnGetCompilerInfo = context.zeDdiTable.Device.pfnGetCompilerInfo; + + if( nullptr == pfnGetCompilerInfo) + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ZE_HANDLE_TRACER_RECURSION(context.zeDdiTable.Device.pfnGetCompilerInfo, hDevice, paramName, pNext, pSize, pData); + + // capture parameters + ze_device_get_compiler_info_params_t tracerParams = { + &hDevice, + ¶mName, + &pNext, + &pSize, + &pData + }; + + tracing_layer::APITracerCallbackDataImp apiCallbackData; + + ZE_GEN_PER_API_CALLBACK_STATE(apiCallbackData, ze_pfnDeviceGetCompilerInfoCb_t, Device, pfnGetCompilerInfoCb); + + + return tracing_layer::APITracerWrapperImp(context.zeDdiTable.Device.pfnGetCompilerInfo, + &tracerParams, + apiCallbackData.apiOrdinal, + apiCallbackData.prologCallbacks, + apiCallbackData.epilogCallbacks, + *tracerParams.phDevice, + *tracerParams.pparamName, + *tracerParams.ppNext, + *tracerParams.ppSize, + *tracerParams.ppData); + } + } // namespace tracing_layer #if defined(__cplusplus) @@ -10383,6 +10716,10 @@ zeGetDeviceProcAddrTable( dditable.pfnGetCounterBasedEventMaxValue = pDdiTable->pfnGetCounterBasedEventMaxValue; pDdiTable->pfnGetCounterBasedEventMaxValue = tracing_layer::zeDeviceGetCounterBasedEventMaxValue; } + if (version >= ZE_API_VERSION_1_18) { + dditable.pfnGetCompilerInfo = pDdiTable->pfnGetCompilerInfo; + pDdiTable->pfnGetCompilerInfo = tracing_layer::zeDeviceGetCompilerInfo; + } if (version >= ZE_API_VERSION_1_2) { dditable.pfnReserveCacheExt = pDdiTable->pfnReserveCacheExt; pDdiTable->pfnReserveCacheExt = tracing_layer::zeDeviceReserveCacheExt; @@ -10548,6 +10885,10 @@ zeGetCommandQueueProcAddrTable( dditable.pfnGetPriority = pDdiTable->pfnGetPriority; pDdiTable->pfnGetPriority = tracing_layer::zeCommandQueueGetPriority; } + if (version >= ZE_API_VERSION_1_18) { + dditable.pfnSetPriorityExt = pDdiTable->pfnSetPriorityExt; + pDdiTable->pfnSetPriorityExt = tracing_layer::zeCommandQueueSetPriorityExt; + } if (version >= ZE_API_VERSION_1_9) { dditable.pfnGetOrdinal = pDdiTable->pfnGetOrdinal; pDdiTable->pfnGetOrdinal = tracing_layer::zeCommandQueueGetOrdinal; @@ -10759,6 +11100,14 @@ zeGetCommandListProcAddrTable( dditable.pfnAppendHostFunction = pDdiTable->pfnAppendHostFunction; pDdiTable->pfnAppendHostFunction = tracing_layer::zeCommandListAppendHostFunction; } + if (version >= ZE_API_VERSION_1_18) { + dditable.pfnAppendSignalEventWithParameters = pDdiTable->pfnAppendSignalEventWithParameters; + pDdiTable->pfnAppendSignalEventWithParameters = tracing_layer::zeCommandListAppendSignalEventWithParameters; + } + if (version >= ZE_API_VERSION_1_18) { + dditable.pfnAppendWaitOnEventsWithParameters = pDdiTable->pfnAppendWaitOnEventsWithParameters; + pDdiTable->pfnAppendWaitOnEventsWithParameters = tracing_layer::zeCommandListAppendWaitOnEventsWithParameters; + } if (version >= ZE_API_VERSION_1_3) { dditable.pfnAppendImageCopyToMemoryExt = pDdiTable->pfnAppendImageCopyToMemoryExt; pDdiTable->pfnAppendImageCopyToMemoryExt = tracing_layer::zeCommandListAppendImageCopyToMemoryExt; @@ -11247,6 +11596,10 @@ zeGetKernelProcAddrTable( dditable.pfnGetName = pDdiTable->pfnGetName; pDdiTable->pfnGetName = tracing_layer::zeKernelGetName; } + if (version >= ZE_API_VERSION_1_18) { + dditable.pfnGetModuleHandle = pDdiTable->pfnGetModuleHandle; + pDdiTable->pfnGetModuleHandle = tracing_layer::zeKernelGetModuleHandle; + } return result; } @@ -11471,6 +11824,10 @@ zeGetModuleProcAddrTable( dditable.pfnGetFunctionPointer = pDdiTable->pfnGetFunctionPointer; pDdiTable->pfnGetFunctionPointer = tracing_layer::zeModuleGetFunctionPointer; } + if (version >= ZE_API_VERSION_1_18) { + dditable.pfnGetDeviceHandle = pDdiTable->pfnGetDeviceHandle; + pDdiTable->pfnGetDeviceHandle = tracing_layer::zeModuleGetDeviceHandle; + } if (version >= ZE_API_VERSION_1_3) { dditable.pfnInspectLinkageExt = pDdiTable->pfnInspectLinkageExt; pDdiTable->pfnInspectLinkageExt = tracing_layer::zeModuleInspectLinkageExt; @@ -11811,6 +12168,18 @@ zeGetGraphProcAddrTable( dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; pDdiTable->pfnDestroyExt = tracing_layer::zeGraphDestroyExt; } + if (version >= ZE_API_VERSION_1_18) { + dditable.pfnPauseCaptureExt = pDdiTable->pfnPauseCaptureExt; + pDdiTable->pfnPauseCaptureExt = tracing_layer::zeGraphPauseCaptureExt; + } + if (version >= ZE_API_VERSION_1_18) { + dditable.pfnResumeCaptureExt = pDdiTable->pfnResumeCaptureExt; + pDdiTable->pfnResumeCaptureExt = tracing_layer::zeGraphResumeCaptureExt; + } + if (version >= ZE_API_VERSION_1_18) { + dditable.pfnGetIdExt = pDdiTable->pfnGetIdExt; + pDdiTable->pfnGetIdExt = tracing_layer::zeGraphGetIdExt; + } return result; } diff --git a/source/layers/validation/checkers/certification/generated/ze_certification.h b/source/layers/validation/checkers/certification/generated/ze_certification.h index 2d1f04b5..5f3839fc 100644 --- a/source/layers/validation/checkers/certification/generated/ze_certification.h +++ b/source/layers/validation/checkers/certification/generated/ze_certification.h @@ -555,12 +555,24 @@ class ZEcertificationCheckerGenerated : public ZEValidationEntryPoints { } return ZE_RESULT_SUCCESS; } + virtual ze_result_t zeCommandListAppendSignalEventWithParametersPrologue( ze_command_list_handle_t hCommandList, const void * pNext, ze_event_handle_t hEvent ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } virtual ze_result_t zeCommandListAppendWaitOnEventsPrologue( ze_command_list_handle_t hCommandList, uint32_t numEvents, ze_event_handle_t* phEvents ) override { if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } + virtual ze_result_t zeCommandListAppendWaitOnEventsWithParametersPrologue( ze_command_list_handle_t hCommandList, const void * pNext, uint32_t numEvents, ze_event_handle_t* phEvents ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } virtual ze_result_t zeEventHostSignalPrologue( ze_event_handle_t hEvent ) override { if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; @@ -825,6 +837,12 @@ class ZEcertificationCheckerGenerated : public ZEValidationEntryPoints { } return ZE_RESULT_SUCCESS; } + virtual ze_result_t zeModuleGetDeviceHandlePrologue( ze_module_handle_t hModule, ze_device_handle_t* phDevice ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } virtual ze_result_t zeKernelCreatePrologue( ze_module_handle_t hModule, const ze_kernel_desc_t* desc, ze_kernel_handle_t* phKernel ) override { if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; @@ -903,6 +921,12 @@ class ZEcertificationCheckerGenerated : public ZEValidationEntryPoints { } return ZE_RESULT_SUCCESS; } + virtual ze_result_t zeKernelGetModuleHandlePrologue( ze_kernel_handle_t hKernel, ze_module_handle_t* phModule ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } virtual ze_result_t zeCommandListAppendLaunchKernelPrologue( ze_command_list_handle_t hCommandList, ze_kernel_handle_t hKernel, const ze_group_count_t* pLaunchFuncArgs, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override { if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_0) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; @@ -1497,11 +1521,41 @@ class ZEcertificationCheckerGenerated : public ZEValidationEntryPoints { } return ZE_RESULT_SUCCESS; } + virtual ze_result_t zeGraphPauseCaptureExtPrologue( ze_graph_handle_t hGraph ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeGraphResumeCaptureExtPrologue( ze_graph_handle_t hGraph ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeGraphGetIdExtPrologue( ze_graph_handle_t hGraph, uint64_t* pGraphId ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } virtual ze_result_t zeCommandListAppendHostFunctionPrologue( ze_command_list_handle_t hCommandList, ze_host_function_callback_t pfnHostFunction, void* pUserData, const void* pNext, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override { if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_17) { return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; } return ZE_RESULT_SUCCESS; } + virtual ze_result_t zeCommandQueueSetPriorityExtPrologue( ze_command_queue_handle_t hCommandQueue, ze_command_queue_priority_t priority ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zeDeviceGetCompilerInfoPrologue( ze_device_handle_t hDevice, ze_device_compiler_info_t paramName, const void* pNext, size_t* pSize, void* pData ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } }; } // namespace validation_layer diff --git a/source/layers/validation/checkers/certification/generated/zes_certification.h b/source/layers/validation/checkers/certification/generated/zes_certification.h index e5bc2130..81efce10 100644 --- a/source/layers/validation/checkers/certification/generated/zes_certification.h +++ b/source/layers/validation/checkers/certification/generated/zes_certification.h @@ -957,5 +957,17 @@ class ZEScertificationCheckerGenerated : public ZESValidationEntryPoints { } return ZE_RESULT_SUCCESS; } + virtual ze_result_t zesDeviceGetHealthStatusExtPrologue( zes_device_handle_t hDevice, zes_device_health_status_ext_t* pHealth ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } + virtual ze_result_t zesDeviceSetHealthStatusExtPrologue( zes_device_handle_t hDevice, zes_device_health_status_ext_t health ) override { + if (GlobalCertificationState::getInstance().certification_version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + return ZE_RESULT_SUCCESS; + } }; } // namespace validation_layer diff --git a/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.cpp b/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.cpp index 9257d917..de9725cd 100644 --- a/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.cpp +++ b/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.cpp @@ -1694,7 +1694,7 @@ namespace validation_layer if( nullptr == phEvent ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if( 0x7f < desc->flags ) + if( 0xff < desc->flags ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; if( 0x7 < desc->signal ) @@ -1861,6 +1861,23 @@ namespace validation_layer } + ze_result_t + ZEParameterValidation::zeCommandListAppendSignalEventWithParametersPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + ze_event_handle_t hEvent ///< [in] handle of the event + ) + { + if( nullptr == hCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == hEvent ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + ze_result_t ZEParameterValidation::zeCommandListAppendWaitOnEventsPrologue( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list @@ -1879,6 +1896,25 @@ namespace validation_layer } + ze_result_t + ZEParameterValidation::zeCommandListAppendWaitOnEventsWithParametersPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + uint32_t numEvents, ///< [in] number of events to wait on before continuing + ze_event_handle_t* phEvents ///< [in][range(0, numEvents)] handles of the events to wait on before + ///< continuing + ) + { + if( nullptr == hCommandList ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == phEvents ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + ze_result_t ZEParameterValidation::zeEventHostSignalPrologue( ze_event_handle_t hEvent ///< [in] handle of the event @@ -2747,6 +2783,22 @@ namespace validation_layer } + ze_result_t + ZEParameterValidation::zeModuleGetDeviceHandlePrologue( + ze_module_handle_t hModule, ///< [in] handle of the module + ze_device_handle_t* phDevice ///< [out] handle of the device the module was created for + ) + { + if( nullptr == hModule ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == phDevice ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + ze_result_t ZEParameterValidation::zeKernelCreatePrologue( ze_module_handle_t hModule, ///< [in] handle of the module @@ -2990,6 +3042,22 @@ namespace validation_layer } + ze_result_t + ZEParameterValidation::zeKernelGetModuleHandlePrologue( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel + ze_module_handle_t* phModule ///< [out] handle of the module the kernel was created from + ) + { + if( nullptr == hKernel ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == phModule ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + ze_result_t ZEParameterValidation::zeCommandListAppendLaunchKernelPrologue( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list @@ -5145,6 +5213,46 @@ namespace validation_layer } + ze_result_t + ZEParameterValidation::zeGraphPauseCaptureExtPrologue( + ze_graph_handle_t hGraph ///< [in] handle to the graph to pause capture + ) + { + if( nullptr == hGraph ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeGraphResumeCaptureExtPrologue( + ze_graph_handle_t hGraph ///< [in] handle to the graph to resume capture + ) + { + if( nullptr == hGraph ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeGraphGetIdExtPrologue( + ze_graph_handle_t hGraph, ///< [in] handle to the graph + uint64_t* pGraphId ///< [out] pointer to the memory where the graph ID will be written + ) + { + if( nullptr == hGraph ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pGraphId ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + ze_result_t ZEParameterValidation::zeCommandListAppendHostFunctionPrologue( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list @@ -5169,4 +5277,47 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } + + ze_result_t + ZEParameterValidation::zeCommandQueueSetPriorityExtPrologue( + ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t priority ///< [in] priority to set for the command queue + ) + { + if( nullptr == hCommandQueue ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < priority ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZEParameterValidation::zeDeviceGetCompilerInfoPrologue( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_device_compiler_info_t paramName, ///< [in] compiler-info to return + const void* pNext, ///< [in][optional] additional extensions passed to the function + size_t* pSize, ///< [in,out] pointer to the size in bytes of the result. + ///< If size is zero, then the driver shall update the value with the total + ///< size in bytes needed. + ///< If size is less than the total size needed, then the driver shall + ///< update the value with the required size and shall not write to pData. + void* pData ///< [in,out][optional][range(0, *pSize)] pointer to the result buffer. + ///< If pData is nullptr, then only the required size is returned in pSize. + ) + { + if( nullptr == hDevice ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( ZE_DEVICE_COMPILER_INFO_DRIVER_OPTIONS < paramName ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; + + if( nullptr == pSize ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + } \ No newline at end of file diff --git a/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.h b/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.h index 5e99aa5b..908464f1 100644 --- a/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.h +++ b/source/layers/validation/checkers/parameter_validation/ze_parameter_validation.h @@ -110,7 +110,9 @@ namespace validation_layer ze_result_t zeEventCounterBasedCloseIpcHandlePrologue( ze_event_handle_t hEvent ) override; ze_result_t zeEventCounterBasedGetDeviceAddressPrologue( ze_event_handle_t hEvent, uint64_t* completionValue, uint64_t* deviceAddress ) override; ze_result_t zeCommandListAppendSignalEventPrologue( ze_command_list_handle_t hCommandList, ze_event_handle_t hEvent ) override; + ze_result_t zeCommandListAppendSignalEventWithParametersPrologue( ze_command_list_handle_t hCommandList, const void * pNext, ze_event_handle_t hEvent ) override; ze_result_t zeCommandListAppendWaitOnEventsPrologue( ze_command_list_handle_t hCommandList, uint32_t numEvents, ze_event_handle_t* phEvents ) override; + ze_result_t zeCommandListAppendWaitOnEventsWithParametersPrologue( ze_command_list_handle_t hCommandList, const void * pNext, uint32_t numEvents, ze_event_handle_t* phEvents ) override; ze_result_t zeEventHostSignalPrologue( ze_event_handle_t hEvent ) override; ze_result_t zeEventHostSynchronizePrologue( ze_event_handle_t hEvent, uint64_t timeout ) override; ze_result_t zeEventQueryStatusPrologue( ze_event_handle_t hEvent ) override; @@ -155,6 +157,7 @@ namespace validation_layer ze_result_t zeModuleGetGlobalPointerPrologue( ze_module_handle_t hModule, const char* pGlobalName, size_t* pSize, void** pptr ) override; ze_result_t zeModuleGetKernelNamesPrologue( ze_module_handle_t hModule, uint32_t* pCount, const char** pNames ) override; ze_result_t zeModuleGetPropertiesPrologue( ze_module_handle_t hModule, ze_module_properties_t* pModuleProperties ) override; + ze_result_t zeModuleGetDeviceHandlePrologue( ze_module_handle_t hModule, ze_device_handle_t* phDevice ) override; ze_result_t zeKernelCreatePrologue( ze_module_handle_t hModule, const ze_kernel_desc_t* desc, ze_kernel_handle_t* phKernel ) override; ze_result_t zeKernelDestroyPrologue( ze_kernel_handle_t hKernel ) override; ze_result_t zeModuleGetFunctionPointerPrologue( ze_module_handle_t hModule, const char* pFunctionName, void** pfnFunction ) override; @@ -168,6 +171,7 @@ namespace validation_layer ze_result_t zeKernelSetCacheConfigPrologue( ze_kernel_handle_t hKernel, ze_cache_config_flags_t flags ) override; ze_result_t zeKernelGetPropertiesPrologue( ze_kernel_handle_t hKernel, ze_kernel_properties_t* pKernelProperties ) override; ze_result_t zeKernelGetNamePrologue( ze_kernel_handle_t hKernel, size_t* pSize, char* pName ) override; + ze_result_t zeKernelGetModuleHandlePrologue( ze_kernel_handle_t hKernel, ze_module_handle_t* phModule ) override; ze_result_t zeCommandListAppendLaunchKernelPrologue( ze_command_list_handle_t hCommandList, ze_kernel_handle_t hKernel, const ze_group_count_t* pLaunchFuncArgs, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; ze_result_t zeCommandListAppendLaunchKernelWithParametersPrologue( ze_command_list_handle_t hCommandList, ze_kernel_handle_t hKernel, const ze_group_count_t* pGroupCounts, const void * pNext, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; ze_result_t zeCommandListAppendLaunchKernelWithArgumentsPrologue( ze_command_list_handle_t hCommandList, ze_kernel_handle_t hKernel, const ze_group_count_t groupCounts, const ze_group_size_t groupSizes, void ** pArguments, const void * pNext, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; @@ -267,6 +271,11 @@ namespace validation_layer ze_result_t zeGraphDumpContentsExtPrologue( ze_graph_handle_t hGraph, const char* filePath, const void* pNext ) override; ze_result_t zeExecutableGraphDestroyExtPrologue( ze_executable_graph_handle_t hGraph ) override; ze_result_t zeGraphDestroyExtPrologue( ze_graph_handle_t hGraph ) override; + ze_result_t zeGraphPauseCaptureExtPrologue( ze_graph_handle_t hGraph ) override; + ze_result_t zeGraphResumeCaptureExtPrologue( ze_graph_handle_t hGraph ) override; + ze_result_t zeGraphGetIdExtPrologue( ze_graph_handle_t hGraph, uint64_t* pGraphId ) override; ze_result_t zeCommandListAppendHostFunctionPrologue( ze_command_list_handle_t hCommandList, ze_host_function_callback_t pfnHostFunction, void* pUserData, const void* pNext, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; + ze_result_t zeCommandQueueSetPriorityExtPrologue( ze_command_queue_handle_t hCommandQueue, ze_command_queue_priority_t priority ) override; + ze_result_t zeDeviceGetCompilerInfoPrologue( ze_device_handle_t hDevice, ze_device_compiler_info_t paramName, const void* pNext, size_t* pSize, void* pData ) override; }; } \ No newline at end of file diff --git a/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.cpp b/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.cpp index 99a089f1..816142bb 100644 --- a/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.cpp +++ b/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.cpp @@ -17,11 +17,11 @@ namespace validation_layer ze_result_t ZESParameterValidation::zesInitPrologue( - zes_init_flags_t flags ///< [in] initialization flags. - ///< currently unused, must be 0 (default). + zes_init_flags_t flags ///< [in] initialization flags. This should be 0 or a combination of + ///< ::zes_init_flags_t values. ) { - if( 0x1 < flags ) + if( 0x7 < flags ) return ZE_RESULT_ERROR_INVALID_ENUMERATION; return ZE_RESULT_SUCCESS; @@ -1975,17 +1975,16 @@ namespace validation_layer ze_result_t ZESParameterValidation::zesPowerGetUsagePrologue( zes_pwr_handle_t hPower, ///< [in] Handle of the power domain. - uint32_t* pInstantPower, ///< [out] Returns the instant power usage in milliwatts. - uint32_t* pAveragePower ///< [out] Returns the average power usage in milliwatts. + uint32_t* pInstantPower, ///< [out][optional] Returns the instant power usage in milliwatts. If this + ///< is `nullptr`, the instant power usage will not be returned. + uint32_t* pAveragePower ///< [out][optional] Returns the average power usage in milliwatts. If this + ///< is `nullptr`, the average power usage will not be returned. ) { if( nullptr == hPower ) return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; - if( nullptr == pInstantPower ) - return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - - if( nullptr == pAveragePower ) + if( (nullptr == pInstantPower) && (nullptr == pAveragePower) ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; return ZE_RESULT_SUCCESS; @@ -3037,4 +3036,36 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } + + ze_result_t + ZESParameterValidation::zesDeviceGetHealthStatusExtPrologue( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_health_status_ext_t* pHealth ///< [out] Current health status of the device. + ) + { + if( nullptr == hDevice ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( nullptr == pHealth ) + return ZE_RESULT_ERROR_INVALID_NULL_POINTER; + + return ZE_RESULT_SUCCESS; + } + + + ze_result_t + ZESParameterValidation::zesDeviceSetHealthStatusExtPrologue( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_health_status_ext_t health ///< [in] New health status to be set for the device. + ) + { + if( nullptr == hDevice ) + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + + if( ZES_DEVICE_HEALTH_STATUS_EXT_FAILED < health ) + return ZE_RESULT_ERROR_INVALID_ENUMERATION; + + return ZE_RESULT_SUCCESS; + } + } \ No newline at end of file diff --git a/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.h b/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.h index e0d7674a..87a6cd2c 100644 --- a/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.h +++ b/source/layers/validation/checkers/parameter_validation/zes_parameter_validation.h @@ -177,5 +177,7 @@ namespace validation_layer ze_result_t zesVFManagementGetVFEngineUtilizationExp2Prologue( zes_vf_handle_t hVFhandle, uint32_t* pCount, zes_vf_util_engine_exp2_t* pEngineUtil ) override; ze_result_t zesVFManagementGetVFCapabilitiesExp2Prologue( zes_vf_handle_t hVFhandle, zes_vf_exp2_capabilities_t* pCapability ) override; ze_result_t zesDevicePciLinkSpeedUpdateExtPrologue( zes_device_handle_t hDevice, ze_bool_t shouldDowngrade, zes_device_action_t* pendingAction ) override; + ze_result_t zesDeviceGetHealthStatusExtPrologue( zes_device_handle_t hDevice, zes_device_health_status_ext_t* pHealth ) override; + ze_result_t zesDeviceSetHealthStatusExtPrologue( zes_device_handle_t hDevice, zes_device_health_status_ext_t health ) override; }; } \ No newline at end of file diff --git a/source/layers/validation/common/ze_entry_points.h b/source/layers/validation/common/ze_entry_points.h index df916fd9..99a6aa84 100644 --- a/source/layers/validation/common/ze_entry_points.h +++ b/source/layers/validation/common/ze_entry_points.h @@ -197,8 +197,12 @@ class ZEValidationEntryPoints { virtual ze_result_t zeEventCounterBasedGetDeviceAddressEpilogue( ze_event_handle_t hEvent, uint64_t* completionValue, uint64_t* deviceAddress , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListAppendSignalEventPrologue( ze_command_list_handle_t hCommandList, ze_event_handle_t hEvent ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListAppendSignalEventEpilogue( ze_command_list_handle_t hCommandList, ze_event_handle_t hEvent , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListAppendSignalEventWithParametersPrologue( ze_command_list_handle_t hCommandList, const void * pNext, ze_event_handle_t hEvent ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListAppendSignalEventWithParametersEpilogue( ze_command_list_handle_t hCommandList, const void * pNext, ze_event_handle_t hEvent , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListAppendWaitOnEventsPrologue( ze_command_list_handle_t hCommandList, uint32_t numEvents, ze_event_handle_t* phEvents ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListAppendWaitOnEventsEpilogue( ze_command_list_handle_t hCommandList, uint32_t numEvents, ze_event_handle_t* phEvents , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListAppendWaitOnEventsWithParametersPrologue( ze_command_list_handle_t hCommandList, const void * pNext, uint32_t numEvents, ze_event_handle_t* phEvents ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandListAppendWaitOnEventsWithParametersEpilogue( ze_command_list_handle_t hCommandList, const void * pNext, uint32_t numEvents, ze_event_handle_t* phEvents , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeEventHostSignalPrologue( ze_event_handle_t hEvent ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeEventHostSignalEpilogue( ze_event_handle_t hEvent , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeEventHostSynchronizePrologue( ze_event_handle_t hEvent, uint64_t timeout ) {return ZE_RESULT_SUCCESS;} @@ -287,6 +291,8 @@ class ZEValidationEntryPoints { virtual ze_result_t zeModuleGetKernelNamesEpilogue( ze_module_handle_t hModule, uint32_t* pCount, const char** pNames , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeModuleGetPropertiesPrologue( ze_module_handle_t hModule, ze_module_properties_t* pModuleProperties ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeModuleGetPropertiesEpilogue( ze_module_handle_t hModule, ze_module_properties_t* pModuleProperties , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeModuleGetDeviceHandlePrologue( ze_module_handle_t hModule, ze_device_handle_t* phDevice ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeModuleGetDeviceHandleEpilogue( ze_module_handle_t hModule, ze_device_handle_t* phDevice , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeKernelCreatePrologue( ze_module_handle_t hModule, const ze_kernel_desc_t* desc, ze_kernel_handle_t* phKernel ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeKernelCreateEpilogue( ze_module_handle_t hModule, const ze_kernel_desc_t* desc, ze_kernel_handle_t* phKernel , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeKernelDestroyPrologue( ze_kernel_handle_t hKernel ) {return ZE_RESULT_SUCCESS;} @@ -313,6 +319,8 @@ class ZEValidationEntryPoints { virtual ze_result_t zeKernelGetPropertiesEpilogue( ze_kernel_handle_t hKernel, ze_kernel_properties_t* pKernelProperties , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeKernelGetNamePrologue( ze_kernel_handle_t hKernel, size_t* pSize, char* pName ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeKernelGetNameEpilogue( ze_kernel_handle_t hKernel, size_t* pSize, char* pName , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeKernelGetModuleHandlePrologue( ze_kernel_handle_t hKernel, ze_module_handle_t* phModule ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeKernelGetModuleHandleEpilogue( ze_kernel_handle_t hKernel, ze_module_handle_t* phModule , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListAppendLaunchKernelPrologue( ze_command_list_handle_t hCommandList, ze_kernel_handle_t hKernel, const ze_group_count_t* pLaunchFuncArgs, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListAppendLaunchKernelEpilogue( ze_command_list_handle_t hCommandList, ze_kernel_handle_t hKernel, const ze_group_count_t* pLaunchFuncArgs, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListAppendLaunchKernelWithParametersPrologue( ze_command_list_handle_t hCommandList, ze_kernel_handle_t hKernel, const ze_group_count_t* pGroupCounts, const void * pNext, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) {return ZE_RESULT_SUCCESS;} @@ -511,8 +519,18 @@ class ZEValidationEntryPoints { virtual ze_result_t zeExecutableGraphDestroyExtEpilogue( ze_executable_graph_handle_t hGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeGraphDestroyExtPrologue( ze_graph_handle_t hGraph ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeGraphDestroyExtEpilogue( ze_graph_handle_t hGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphPauseCaptureExtPrologue( ze_graph_handle_t hGraph ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphPauseCaptureExtEpilogue( ze_graph_handle_t hGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphResumeCaptureExtPrologue( ze_graph_handle_t hGraph ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphResumeCaptureExtEpilogue( ze_graph_handle_t hGraph , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphGetIdExtPrologue( ze_graph_handle_t hGraph, uint64_t* pGraphId ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeGraphGetIdExtEpilogue( ze_graph_handle_t hGraph, uint64_t* pGraphId , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListAppendHostFunctionPrologue( ze_command_list_handle_t hCommandList, ze_host_function_callback_t pfnHostFunction, void* pUserData, const void* pNext, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zeCommandListAppendHostFunctionEpilogue( ze_command_list_handle_t hCommandList, ze_host_function_callback_t pfnHostFunction, void* pUserData, const void* pNext, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandQueueSetPriorityExtPrologue( ze_command_queue_handle_t hCommandQueue, ze_command_queue_priority_t priority ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeCommandQueueSetPriorityExtEpilogue( ze_command_queue_handle_t hCommandQueue, ze_command_queue_priority_t priority , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeDeviceGetCompilerInfoPrologue( ze_device_handle_t hDevice, ze_device_compiler_info_t paramName, const void* pNext, size_t* pSize, void* pData ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zeDeviceGetCompilerInfoEpilogue( ze_device_handle_t hDevice, ze_device_compiler_info_t paramName, const void* pNext, size_t* pSize, void* pData , ze_result_t result) {return ZE_RESULT_SUCCESS;} // Experimental Intel extension for counter-based events virtual ze_result_t zexCounterBasedEventCreate2Prologue( ze_context_handle_t hContext, ze_device_handle_t hDevice, const void* desc, ze_event_handle_t* phEvent ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zexCounterBasedEventCreate2Epilogue( ze_context_handle_t hContext, ze_device_handle_t hDevice, const void* desc, ze_event_handle_t* phEvent , ze_result_t result) {return ZE_RESULT_SUCCESS;} diff --git a/source/layers/validation/common/zes_entry_points.h b/source/layers/validation/common/zes_entry_points.h index 5150a8b7..374b5c45 100644 --- a/source/layers/validation/common/zes_entry_points.h +++ b/source/layers/validation/common/zes_entry_points.h @@ -331,6 +331,10 @@ class ZESValidationEntryPoints { virtual ze_result_t zesVFManagementGetVFCapabilitiesExp2Epilogue( zes_vf_handle_t hVFhandle, zes_vf_exp2_capabilities_t* pCapability , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zesDevicePciLinkSpeedUpdateExtPrologue( zes_device_handle_t hDevice, ze_bool_t shouldDowngrade, zes_device_action_t* pendingAction ) {return ZE_RESULT_SUCCESS;} virtual ze_result_t zesDevicePciLinkSpeedUpdateExtEpilogue( zes_device_handle_t hDevice, ze_bool_t shouldDowngrade, zes_device_action_t* pendingAction , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zesDeviceGetHealthStatusExtPrologue( zes_device_handle_t hDevice, zes_device_health_status_ext_t* pHealth ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zesDeviceGetHealthStatusExtEpilogue( zes_device_handle_t hDevice, zes_device_health_status_ext_t* pHealth , ze_result_t result) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zesDeviceSetHealthStatusExtPrologue( zes_device_handle_t hDevice, zes_device_health_status_ext_t health ) {return ZE_RESULT_SUCCESS;} + virtual ze_result_t zesDeviceSetHealthStatusExtEpilogue( zes_device_handle_t hDevice, zes_device_health_status_ext_t health , ze_result_t result) {return ZE_RESULT_SUCCESS;} virtual ~ZESValidationEntryPoints() {} }; } \ No newline at end of file diff --git a/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.cpp b/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.cpp index 9e43aa9b..a279b42c 100644 --- a/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.cpp +++ b/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.cpp @@ -1531,6 +1531,25 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t + ZEHandleLifetimeValidation::zeCommandListAppendSignalEventWithParametersPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + ze_event_handle_t hEvent ///< [in] handle of the event + ) + { + + if ( !context.handleLifetime->isHandleValid( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if (!context.handleLifetime->isOpen( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_ARGUMENT; + } + if ( !context.handleLifetime->isHandleValid( hEvent )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t ZEHandleLifetimeValidation::zeCommandListAppendWaitOnEventsPrologue( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list uint32_t numEvents, ///< [in] number of events to wait on before continuing @@ -1553,6 +1572,29 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t + ZEHandleLifetimeValidation::zeCommandListAppendWaitOnEventsWithParametersPrologue( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + uint32_t numEvents, ///< [in] number of events to wait on before continuing + ze_event_handle_t* phEvents ///< [in][range(0, numEvents)] handles of the events to wait on before + ///< continuing + ) + { + + if ( !context.handleLifetime->isHandleValid( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + if (!context.handleLifetime->isOpen( hCommandList )){ + return ZE_RESULT_ERROR_INVALID_ARGUMENT; + } + for (size_t i = 0; ( nullptr != phEvents) && (i < numEvents); ++i){ + if (!context.handleLifetime->isHandleValid( phEvents[i] )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + } + return ZE_RESULT_SUCCESS; + } + ze_result_t ZEHandleLifetimeValidation::zeEventHostSignalPrologue( ze_event_handle_t hEvent ///< [in] handle of the event ) @@ -2226,6 +2268,18 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t + ZEHandleLifetimeValidation::zeModuleGetDeviceHandlePrologue( + ze_module_handle_t hModule, ///< [in] handle of the module + ze_device_handle_t* phDevice ///< [out] handle of the device the module was created for + ) + { + + if ( !context.handleLifetime->isHandleValid( hModule )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t ZEHandleLifetimeValidation::zeKernelCreatePrologue( ze_module_handle_t hModule, ///< [in] handle of the module const ze_kernel_desc_t* desc, ///< [in] pointer to kernel descriptor @@ -2414,6 +2468,18 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t + ZEHandleLifetimeValidation::zeKernelGetModuleHandlePrologue( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel + ze_module_handle_t* phModule ///< [out] handle of the module the kernel was created from + ) + { + + if ( !context.handleLifetime->isHandleValid( hKernel )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t ZEHandleLifetimeValidation::zeCommandListAppendLaunchKernelPrologue( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object @@ -4206,6 +4272,40 @@ namespace validation_layer return ZE_RESULT_SUCCESS; } ze_result_t + ZEHandleLifetimeValidation::zeGraphPauseCaptureExtPrologue( + ze_graph_handle_t hGraph ///< [in] handle to the graph to pause capture + ) + { + + if ( !context.handleLifetime->isHandleValid( hGraph )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeGraphResumeCaptureExtPrologue( + ze_graph_handle_t hGraph ///< [in] handle to the graph to resume capture + ) + { + + if ( !context.handleLifetime->isHandleValid( hGraph )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeGraphGetIdExtPrologue( + ze_graph_handle_t hGraph, ///< [in] handle to the graph + uint64_t* pGraphId ///< [out] pointer to the memory where the graph ID will be written + ) + { + + if ( !context.handleLifetime->isHandleValid( hGraph )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t ZEHandleLifetimeValidation::zeCommandListAppendHostFunctionPrologue( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list ze_host_function_callback_t pfnHostFunction, ///< [in] host function to call, expected to be lightweight and @@ -4237,6 +4337,38 @@ namespace validation_layer } return ZE_RESULT_SUCCESS; } + ze_result_t + ZEHandleLifetimeValidation::zeCommandQueueSetPriorityExtPrologue( + ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t priority ///< [in] priority to set for the command queue + ) + { + + if ( !context.handleLifetime->isHandleValid( hCommandQueue )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZEHandleLifetimeValidation::zeDeviceGetCompilerInfoPrologue( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_device_compiler_info_t paramName, ///< [in] compiler-info to return + const void* pNext, ///< [in][optional] additional extensions passed to the function + size_t* pSize, ///< [in,out] pointer to the size in bytes of the result. + ///< If size is zero, then the driver shall update the value with the total + ///< size in bytes needed. + ///< If size is less than the total size needed, then the driver shall + ///< update the value with the required size and shall not write to pData. + void* pData ///< [in,out][optional][range(0, *pSize)] pointer to the result buffer. + ///< If pData is nullptr, then only the required size is returned in pSize. + ) + { + + if ( !context.handleLifetime->isHandleValid( hDevice )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } ze_result_t ZEHandleLifetimeValidation::zexCounterBasedEventCreate2Prologue( ze_context_handle_t hContext, ///< [in] handle of the context object ze_device_handle_t hDevice, ///< [in] handle of the device diff --git a/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.h b/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.h index e7b2452c..4b48ec8d 100644 --- a/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.h +++ b/source/layers/validation/handle_lifetime_tracking/ze_handle_lifetime.h @@ -106,7 +106,9 @@ namespace validation_layer ze_result_t zeEventCounterBasedCloseIpcHandlePrologue( ze_event_handle_t hEvent ) override; ze_result_t zeEventCounterBasedGetDeviceAddressPrologue( ze_event_handle_t hEvent, uint64_t* completionValue, uint64_t* deviceAddress ) override; ze_result_t zeCommandListAppendSignalEventPrologue( ze_command_list_handle_t hCommandList, ze_event_handle_t hEvent ) override; + ze_result_t zeCommandListAppendSignalEventWithParametersPrologue( ze_command_list_handle_t hCommandList, const void * pNext, ze_event_handle_t hEvent ) override; ze_result_t zeCommandListAppendWaitOnEventsPrologue( ze_command_list_handle_t hCommandList, uint32_t numEvents, ze_event_handle_t* phEvents ) override; + ze_result_t zeCommandListAppendWaitOnEventsWithParametersPrologue( ze_command_list_handle_t hCommandList, const void * pNext, uint32_t numEvents, ze_event_handle_t* phEvents ) override; ze_result_t zeEventHostSignalPrologue( ze_event_handle_t hEvent ) override; ze_result_t zeEventHostSynchronizePrologue( ze_event_handle_t hEvent, uint64_t timeout ) override; ze_result_t zeEventQueryStatusPrologue( ze_event_handle_t hEvent ) override; @@ -151,6 +153,7 @@ namespace validation_layer ze_result_t zeModuleGetGlobalPointerPrologue( ze_module_handle_t hModule, const char* pGlobalName, size_t* pSize, void** pptr ) override; ze_result_t zeModuleGetKernelNamesPrologue( ze_module_handle_t hModule, uint32_t* pCount, const char** pNames ) override; ze_result_t zeModuleGetPropertiesPrologue( ze_module_handle_t hModule, ze_module_properties_t* pModuleProperties ) override; + ze_result_t zeModuleGetDeviceHandlePrologue( ze_module_handle_t hModule, ze_device_handle_t* phDevice ) override; ze_result_t zeKernelCreatePrologue( ze_module_handle_t hModule, const ze_kernel_desc_t* desc, ze_kernel_handle_t* phKernel ) override; ze_result_t zeKernelDestroyPrologue( ze_kernel_handle_t hKernel ) override; ze_result_t zeModuleGetFunctionPointerPrologue( ze_module_handle_t hModule, const char* pFunctionName, void** pfnFunction ) override; @@ -164,6 +167,7 @@ namespace validation_layer ze_result_t zeKernelSetCacheConfigPrologue( ze_kernel_handle_t hKernel, ze_cache_config_flags_t flags ) override; ze_result_t zeKernelGetPropertiesPrologue( ze_kernel_handle_t hKernel, ze_kernel_properties_t* pKernelProperties ) override; ze_result_t zeKernelGetNamePrologue( ze_kernel_handle_t hKernel, size_t* pSize, char* pName ) override; + ze_result_t zeKernelGetModuleHandlePrologue( ze_kernel_handle_t hKernel, ze_module_handle_t* phModule ) override; ze_result_t zeCommandListAppendLaunchKernelPrologue( ze_command_list_handle_t hCommandList, ze_kernel_handle_t hKernel, const ze_group_count_t* pLaunchFuncArgs, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; ze_result_t zeCommandListAppendLaunchKernelWithParametersPrologue( ze_command_list_handle_t hCommandList, ze_kernel_handle_t hKernel, const ze_group_count_t* pGroupCounts, const void * pNext, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; ze_result_t zeCommandListAppendLaunchKernelWithArgumentsPrologue( ze_command_list_handle_t hCommandList, ze_kernel_handle_t hKernel, const ze_group_count_t groupCounts, const ze_group_size_t groupSizes, void ** pArguments, const void * pNext, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; @@ -263,7 +267,12 @@ namespace validation_layer ze_result_t zeGraphDumpContentsExtPrologue( ze_graph_handle_t hGraph, const char* filePath, const void* pNext ) override; ze_result_t zeExecutableGraphDestroyExtPrologue( ze_executable_graph_handle_t hGraph ) override; ze_result_t zeGraphDestroyExtPrologue( ze_graph_handle_t hGraph ) override; + ze_result_t zeGraphPauseCaptureExtPrologue( ze_graph_handle_t hGraph ) override; + ze_result_t zeGraphResumeCaptureExtPrologue( ze_graph_handle_t hGraph ) override; + ze_result_t zeGraphGetIdExtPrologue( ze_graph_handle_t hGraph, uint64_t* pGraphId ) override; ze_result_t zeCommandListAppendHostFunctionPrologue( ze_command_list_handle_t hCommandList, ze_host_function_callback_t pfnHostFunction, void* pUserData, const void* pNext, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t* phWaitEvents ) override; + ze_result_t zeCommandQueueSetPriorityExtPrologue( ze_command_queue_handle_t hCommandQueue, ze_command_queue_priority_t priority ) override; + ze_result_t zeDeviceGetCompilerInfoPrologue( ze_device_handle_t hDevice, ze_device_compiler_info_t paramName, const void* pNext, size_t* pSize, void* pData ) override; // Experimental function for Intel counter-based events ze_result_t zexCounterBasedEventCreate2Prologue(ze_context_handle_t hContext, ze_device_handle_t hDevice, const void *desc, ze_event_handle_t *phEvent) override; }; diff --git a/source/layers/validation/handle_lifetime_tracking/zes_handle_lifetime.cpp b/source/layers/validation/handle_lifetime_tracking/zes_handle_lifetime.cpp index aa6a2b24..6d195917 100644 --- a/source/layers/validation/handle_lifetime_tracking/zes_handle_lifetime.cpp +++ b/source/layers/validation/handle_lifetime_tracking/zes_handle_lifetime.cpp @@ -1517,8 +1517,10 @@ namespace validation_layer ze_result_t ZESHandleLifetimeValidation::zesPowerGetUsagePrologue( zes_pwr_handle_t hPower, ///< [in] Handle of the power domain. - uint32_t* pInstantPower, ///< [out] Returns the instant power usage in milliwatts. - uint32_t* pAveragePower ///< [out] Returns the average power usage in milliwatts. + uint32_t* pInstantPower, ///< [out][optional] Returns the instant power usage in milliwatts. If this + ///< is `nullptr`, the instant power usage will not be returned. + uint32_t* pAveragePower ///< [out][optional] Returns the average power usage in milliwatts. If this + ///< is `nullptr`, the average power usage will not be returned. ) { @@ -2347,6 +2349,30 @@ namespace validation_layer ) { + if ( !context.handleLifetime->isHandleValid( hDevice )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZESHandleLifetimeValidation::zesDeviceGetHealthStatusExtPrologue( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_health_status_ext_t* pHealth ///< [out] Current health status of the device. + ) + { + + if ( !context.handleLifetime->isHandleValid( hDevice )){ + return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; + } + return ZE_RESULT_SUCCESS; + } + ze_result_t + ZESHandleLifetimeValidation::zesDeviceSetHealthStatusExtPrologue( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_health_status_ext_t health ///< [in] New health status to be set for the device. + ) + { + if ( !context.handleLifetime->isHandleValid( hDevice )){ return ZE_RESULT_ERROR_INVALID_NULL_HANDLE; } diff --git a/source/layers/validation/handle_lifetime_tracking/zes_handle_lifetime.h b/source/layers/validation/handle_lifetime_tracking/zes_handle_lifetime.h index a485b546..a391556f 100644 --- a/source/layers/validation/handle_lifetime_tracking/zes_handle_lifetime.h +++ b/source/layers/validation/handle_lifetime_tracking/zes_handle_lifetime.h @@ -174,6 +174,8 @@ namespace validation_layer ze_result_t zesVFManagementGetVFEngineUtilizationExp2Prologue( zes_vf_handle_t hVFhandle, uint32_t* pCount, zes_vf_util_engine_exp2_t* pEngineUtil ) override; ze_result_t zesVFManagementGetVFCapabilitiesExp2Prologue( zes_vf_handle_t hVFhandle, zes_vf_exp2_capabilities_t* pCapability ) override; ze_result_t zesDevicePciLinkSpeedUpdateExtPrologue( zes_device_handle_t hDevice, ze_bool_t shouldDowngrade, zes_device_action_t* pendingAction ) override; + ze_result_t zesDeviceGetHealthStatusExtPrologue( zes_device_handle_t hDevice, zes_device_health_status_ext_t* pHealth ) override; + ze_result_t zesDeviceSetHealthStatusExtPrologue( zes_device_handle_t hDevice, zes_device_health_status_ext_t health ) override; }; } diff --git a/source/layers/validation/ze_valddi.cpp b/source/layers/validation/ze_valddi.cpp index 0777508f..9e5d7c4f 100644 --- a/source/layers/validation/ze_valddi.cpp +++ b/source/layers/validation/ze_valddi.cpp @@ -2984,6 +2984,35 @@ namespace validation_layer oss << "hCommandList="; oss << loader::to_string(hCommandList); + oss << ", "; + oss << "hEvent="; + oss << loader::to_string(hEvent); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendSignalEventWithParameters( + ze_result_t result, + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + ze_event_handle_t hEvent ///< [in] handle of the event +) { + // Only log success results if verbose logging is enabled + if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { + return result; + } + std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; + std::ostringstream oss; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListAppendSignalEventWithParameters("; + + + oss << "hCommandList="; + oss << loader::to_string(hCommandList); + + oss << ", "; + oss << "pNext="; + oss << loader::to_string(pNext); + oss << ", "; oss << "hEvent="; oss << loader::to_string(hEvent); @@ -3014,6 +3043,41 @@ namespace validation_layer oss << "numEvents="; oss << loader::to_string(numEvents); + oss << ", "; + oss << "phEvents="; + oss << loader::to_string(phEvents); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendWaitOnEventsWithParameters( + ze_result_t result, + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + uint32_t numEvents, ///< [in] number of events to wait on before continuing + ze_event_handle_t* phEvents ///< [in][range(0, numEvents)] handles of the events to wait on before + ///< continuing +) { + // Only log success results if verbose logging is enabled + if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { + return result; + } + std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; + std::ostringstream oss; + oss << status << " (" << loader::to_string(result) << ") in zeCommandListAppendWaitOnEventsWithParameters("; + + + oss << "hCommandList="; + oss << loader::to_string(hCommandList); + + oss << ", "; + oss << "pNext="; + oss << loader::to_string(pNext); + + oss << ", "; + oss << "numEvents="; + oss << loader::to_string(numEvents); + oss << ", "; oss << "phEvents="; oss << loader::to_string(phEvents); @@ -4409,6 +4473,35 @@ namespace validation_layer oss << ")"; context.logger->log_trace(oss.str()); return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeModuleGetDeviceHandle( + ze_result_t result, + ze_module_handle_t hModule, ///< [in] handle of the module + ze_device_handle_t* phDevice ///< [out] handle of the device the module was created for +) { + // Only log success results if verbose logging is enabled + if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { + return result; + } + std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; + std::ostringstream oss; + oss << status << " (" << loader::to_string(result) << ") in zeModuleGetDeviceHandle("; + + + oss << "hModule="; + oss << loader::to_string(hModule); + + oss << ", "; + oss << "phDevice="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phDevice != nullptr) { + oss << loader::to_string(*phDevice); + } else { + oss << loader::to_string(phDevice); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; } VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeKernelCreate( ze_result_t result, @@ -4830,6 +4923,35 @@ namespace validation_layer oss << ")"; context.logger->log_trace(oss.str()); return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeKernelGetModuleHandle( + ze_result_t result, + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel + ze_module_handle_t* phModule ///< [out] handle of the module the kernel was created from +) { + // Only log success results if verbose logging is enabled + if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { + return result; + } + std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; + std::ostringstream oss; + oss << status << " (" << loader::to_string(result) << ") in zeKernelGetModuleHandle("; + + + oss << "hKernel="; + oss << loader::to_string(hKernel); + + oss << ", "; + oss << "phModule="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && phModule != nullptr) { + oss << loader::to_string(*phModule); + } else { + oss << loader::to_string(phModule); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; } VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendLaunchKernel( ze_result_t result, @@ -8305,6 +8427,73 @@ namespace validation_layer oss << ")"; context.logger->log_trace(oss.str()); return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphPauseCaptureExt( + ze_result_t result, + ze_graph_handle_t hGraph ///< [in] handle to the graph to pause capture +) { + // Only log success results if verbose logging is enabled + if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { + return result; + } + std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; + std::ostringstream oss; + oss << status << " (" << loader::to_string(result) << ") in zeGraphPauseCaptureExt("; + + + oss << "hGraph="; + oss << loader::to_string(hGraph); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphResumeCaptureExt( + ze_result_t result, + ze_graph_handle_t hGraph ///< [in] handle to the graph to resume capture +) { + // Only log success results if verbose logging is enabled + if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { + return result; + } + std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; + std::ostringstream oss; + oss << status << " (" << loader::to_string(result) << ") in zeGraphResumeCaptureExt("; + + + oss << "hGraph="; + oss << loader::to_string(hGraph); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeGraphGetIdExt( + ze_result_t result, + ze_graph_handle_t hGraph, ///< [in] handle to the graph + uint64_t* pGraphId ///< [out] pointer to the memory where the graph ID will be written +) { + // Only log success results if verbose logging is enabled + if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { + return result; + } + std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; + std::ostringstream oss; + oss << status << " (" << loader::to_string(result) << ") in zeGraphGetIdExt("; + + + oss << "hGraph="; + oss << loader::to_string(hGraph); + + oss << ", "; + oss << "pGraphId="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pGraphId != nullptr) { + oss << loader::to_string(*pGraphId); + } else { + oss << loader::to_string(pGraphId); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; } VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandListAppendHostFunction( ze_result_t result, @@ -8358,6 +8547,74 @@ namespace validation_layer oss << ")"; context.logger->log_trace(oss.str()); return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeCommandQueueSetPriorityExt( + ze_result_t result, + ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t priority ///< [in] priority to set for the command queue +) { + // Only log success results if verbose logging is enabled + if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { + return result; + } + std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; + std::ostringstream oss; + oss << status << " (" << loader::to_string(result) << ") in zeCommandQueueSetPriorityExt("; + + + oss << "hCommandQueue="; + oss << loader::to_string(hCommandQueue); + + oss << ", "; + oss << "priority="; + oss << loader::to_string(priority); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zeDeviceGetCompilerInfo( + ze_result_t result, + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_device_compiler_info_t paramName, ///< [in] compiler-info to return + const void* pNext, ///< [in][optional] additional extensions passed to the function + size_t* pSize, ///< [in,out] pointer to the size in bytes of the result. + ///< If size is zero, then the driver shall update the value with the total + ///< size in bytes needed. + ///< If size is less than the total size needed, then the driver shall + ///< update the value with the required size and shall not write to pData. + void* pData ///< [in,out][optional][range(0, *pSize)] pointer to the result buffer. + ///< If pData is nullptr, then only the required size is returned in pSize. +) { + // Only log success results if verbose logging is enabled + if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { + return result; + } + std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; + std::ostringstream oss; + oss << status << " (" << loader::to_string(result) << ") in zeDeviceGetCompilerInfo("; + + + oss << "hDevice="; + oss << loader::to_string(hDevice); + + oss << ", "; + oss << "paramName="; + oss << loader::to_string(paramName); + + oss << ", "; + oss << "pNext="; + oss << loader::to_string(pNext); + + oss << ", "; + oss << "pSize="; + oss << loader::to_string(pSize); + + oss << ", "; + oss << "pData="; + oss << loader::to_string(pData); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; } // Special function for zexCounterBasedEventCreate2 VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zexCounterBasedEventCreate2( @@ -12527,6 +12784,49 @@ namespace validation_layer return logAndPropagateResult_zeCommandListAppendSignalEvent(driver_result, hCommandList, hEvent); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendSignalEventWithParameters + __zedlllocal ze_result_t ZE_APICALL + zeCommandListAppendSignalEventWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + ze_event_handle_t hEvent ///< [in] handle of the event + ) + { + context.logger->log_trace("zeCommandListAppendSignalEventWithParameters(hCommandList, pNext, hEvent)"); + + auto pfnAppendSignalEventWithParameters = context.zeDdiTable.CommandList.pfnAppendSignalEventWithParameters; + + if( nullptr == pfnAppendSignalEventWithParameters ) + return logAndPropagateResult_zeCommandListAppendSignalEventWithParameters(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pNext, hEvent); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendSignalEventWithParametersPrologue( hCommandList, pNext, hEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalEventWithParameters(result, hCommandList, pNext, hEvent); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendSignalEventWithParametersPrologue( hCommandList, pNext, hEvent ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalEventWithParameters(result, hCommandList, pNext, hEvent); + } + + auto driver_result = pfnAppendSignalEventWithParameters( hCommandList, pNext, hEvent ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendSignalEventWithParametersEpilogue( hCommandList, pNext, hEvent ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendSignalEventWithParameters(result, hCommandList, pNext, hEvent); + } + + return logAndPropagateResult_zeCommandListAppendSignalEventWithParameters(driver_result, hCommandList, pNext, hEvent); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListAppendWaitOnEvents __zedlllocal ze_result_t ZE_APICALL @@ -12571,6 +12871,51 @@ namespace validation_layer return logAndPropagateResult_zeCommandListAppendWaitOnEvents(driver_result, hCommandList, numEvents, phEvents); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendWaitOnEventsWithParameters + __zedlllocal ze_result_t ZE_APICALL + zeCommandListAppendWaitOnEventsWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + uint32_t numEvents, ///< [in] number of events to wait on before continuing + ze_event_handle_t* phEvents ///< [in][range(0, numEvents)] handles of the events to wait on before + ///< continuing + ) + { + context.logger->log_trace("zeCommandListAppendWaitOnEventsWithParameters(hCommandList, pNext, numEvents, phEventsLocal)"); + + auto pfnAppendWaitOnEventsWithParameters = context.zeDdiTable.CommandList.pfnAppendWaitOnEventsWithParameters; + + if( nullptr == pfnAppendWaitOnEventsWithParameters ) + return logAndPropagateResult_zeCommandListAppendWaitOnEventsWithParameters(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandList, pNext, numEvents, phEvents); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendWaitOnEventsWithParametersPrologue( hCommandList, pNext, numEvents, phEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitOnEventsWithParameters(result, hCommandList, pNext, numEvents, phEvents); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeCommandListAppendWaitOnEventsWithParametersPrologue( hCommandList, pNext, numEvents, phEvents ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitOnEventsWithParameters(result, hCommandList, pNext, numEvents, phEvents); + } + + auto driver_result = pfnAppendWaitOnEventsWithParameters( hCommandList, pNext, numEvents, phEvents ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeCommandListAppendWaitOnEventsWithParametersEpilogue( hCommandList, pNext, numEvents, phEvents ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandListAppendWaitOnEventsWithParameters(result, hCommandList, pNext, numEvents, phEvents); + } + + return logAndPropagateResult_zeCommandListAppendWaitOnEventsWithParameters(driver_result, hCommandList, pNext, numEvents, phEvents); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeEventHostSignal __zedlllocal ze_result_t ZE_APICALL @@ -14543,6 +14888,48 @@ namespace validation_layer return logAndPropagateResult_zeModuleGetProperties(driver_result, hModule, pModuleProperties); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeModuleGetDeviceHandle + __zedlllocal ze_result_t ZE_APICALL + zeModuleGetDeviceHandle( + ze_module_handle_t hModule, ///< [in] handle of the module + ze_device_handle_t* phDevice ///< [out] handle of the device the module was created for + ) + { + context.logger->log_trace("zeModuleGetDeviceHandle(hModule, phDevice)"); + + auto pfnGetDeviceHandle = context.zeDdiTable.Module.pfnGetDeviceHandle; + + if( nullptr == pfnGetDeviceHandle ) + return logAndPropagateResult_zeModuleGetDeviceHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hModule, phDevice); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeModuleGetDeviceHandlePrologue( hModule, phDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetDeviceHandle(result, hModule, phDevice); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeModuleGetDeviceHandlePrologue( hModule, phDevice ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetDeviceHandle(result, hModule, phDevice); + } + + auto driver_result = pfnGetDeviceHandle( hModule, phDevice ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeModuleGetDeviceHandleEpilogue( hModule, phDevice ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeModuleGetDeviceHandle(result, hModule, phDevice); + } + + return logAndPropagateResult_zeModuleGetDeviceHandle(driver_result, hModule, phDevice); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeKernelCreate __zedlllocal ze_result_t ZE_APICALL @@ -15124,6 +15511,48 @@ namespace validation_layer return logAndPropagateResult_zeKernelGetName(driver_result, hKernel, pSize, pName); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeKernelGetModuleHandle + __zedlllocal ze_result_t ZE_APICALL + zeKernelGetModuleHandle( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel + ze_module_handle_t* phModule ///< [out] handle of the module the kernel was created from + ) + { + context.logger->log_trace("zeKernelGetModuleHandle(hKernel, phModule)"); + + auto pfnGetModuleHandle = context.zeDdiTable.Kernel.pfnGetModuleHandle; + + if( nullptr == pfnGetModuleHandle ) + return logAndPropagateResult_zeKernelGetModuleHandle(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hKernel, phModule); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeKernelGetModuleHandlePrologue( hKernel, phModule ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetModuleHandle(result, hKernel, phModule); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeKernelGetModuleHandlePrologue( hKernel, phModule ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetModuleHandle(result, hKernel, phModule); + } + + auto driver_result = pfnGetModuleHandle( hKernel, phModule ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeKernelGetModuleHandleEpilogue( hKernel, phModule ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeKernelGetModuleHandle(result, hKernel, phModule); + } + + return logAndPropagateResult_zeKernelGetModuleHandle(driver_result, hKernel, phModule); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListAppendLaunchKernel __zedlllocal ze_result_t ZE_APICALL @@ -19771,6 +20200,130 @@ namespace validation_layer return logAndPropagateResult_zeGraphDestroyExt(driver_result, hGraph); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphPauseCaptureExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphPauseCaptureExt( + ze_graph_handle_t hGraph ///< [in] handle to the graph to pause capture + ) + { + context.logger->log_trace("zeGraphPauseCaptureExt(hGraph)"); + + auto pfnPauseCaptureExt = context.zeDdiTable.Graph.pfnPauseCaptureExt; + + if( nullptr == pfnPauseCaptureExt ) + return logAndPropagateResult_zeGraphPauseCaptureExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeGraphPauseCaptureExtPrologue( hGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphPauseCaptureExt(result, hGraph); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeGraphPauseCaptureExtPrologue( hGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphPauseCaptureExt(result, hGraph); + } + + auto driver_result = pfnPauseCaptureExt( hGraph ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeGraphPauseCaptureExtEpilogue( hGraph ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphPauseCaptureExt(result, hGraph); + } + + return logAndPropagateResult_zeGraphPauseCaptureExt(driver_result, hGraph); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphResumeCaptureExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphResumeCaptureExt( + ze_graph_handle_t hGraph ///< [in] handle to the graph to resume capture + ) + { + context.logger->log_trace("zeGraphResumeCaptureExt(hGraph)"); + + auto pfnResumeCaptureExt = context.zeDdiTable.Graph.pfnResumeCaptureExt; + + if( nullptr == pfnResumeCaptureExt ) + return logAndPropagateResult_zeGraphResumeCaptureExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeGraphResumeCaptureExtPrologue( hGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphResumeCaptureExt(result, hGraph); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeGraphResumeCaptureExtPrologue( hGraph ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphResumeCaptureExt(result, hGraph); + } + + auto driver_result = pfnResumeCaptureExt( hGraph ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeGraphResumeCaptureExtEpilogue( hGraph ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphResumeCaptureExt(result, hGraph); + } + + return logAndPropagateResult_zeGraphResumeCaptureExt(driver_result, hGraph); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphGetIdExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphGetIdExt( + ze_graph_handle_t hGraph, ///< [in] handle to the graph + uint64_t* pGraphId ///< [out] pointer to the memory where the graph ID will be written + ) + { + context.logger->log_trace("zeGraphGetIdExt(hGraph, pGraphId)"); + + auto pfnGetIdExt = context.zeDdiTable.Graph.pfnGetIdExt; + + if( nullptr == pfnGetIdExt ) + return logAndPropagateResult_zeGraphGetIdExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hGraph, pGraphId); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeGraphGetIdExtPrologue( hGraph, pGraphId ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphGetIdExt(result, hGraph, pGraphId); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeGraphGetIdExtPrologue( hGraph, pGraphId ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphGetIdExt(result, hGraph, pGraphId); + } + + auto driver_result = pfnGetIdExt( hGraph, pGraphId ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeGraphGetIdExtEpilogue( hGraph, pGraphId ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeGraphGetIdExt(result, hGraph, pGraphId); + } + + return logAndPropagateResult_zeGraphGetIdExt(driver_result, hGraph, pGraphId); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListAppendHostFunction __zedlllocal ze_result_t ZE_APICALL @@ -19822,6 +20375,98 @@ namespace validation_layer return logAndPropagateResult_zeCommandListAppendHostFunction(driver_result, hCommandList, pfnHostFunction, pUserData, pNext, hSignalEvent, numWaitEvents, phWaitEvents); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueSetPriorityExt + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueSetPriorityExt( + ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t priority ///< [in] priority to set for the command queue + ) + { + context.logger->log_trace("zeCommandQueueSetPriorityExt(hCommandQueue, priority)"); + + auto pfnSetPriorityExt = context.zeDdiTable.CommandQueue.pfnSetPriorityExt; + + if( nullptr == pfnSetPriorityExt ) + return logAndPropagateResult_zeCommandQueueSetPriorityExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hCommandQueue, priority); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueSetPriorityExtPrologue( hCommandQueue, priority ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueSetPriorityExt(result, hCommandQueue, priority); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeCommandQueueSetPriorityExtPrologue( hCommandQueue, priority ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueSetPriorityExt(result, hCommandQueue, priority); + } + + auto driver_result = pfnSetPriorityExt( hCommandQueue, priority ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeCommandQueueSetPriorityExtEpilogue( hCommandQueue, priority ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeCommandQueueSetPriorityExt(result, hCommandQueue, priority); + } + + return logAndPropagateResult_zeCommandQueueSetPriorityExt(driver_result, hCommandQueue, priority); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetCompilerInfo + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetCompilerInfo( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_device_compiler_info_t paramName, ///< [in] compiler-info to return + const void* pNext, ///< [in][optional] additional extensions passed to the function + size_t* pSize, ///< [in,out] pointer to the size in bytes of the result. + ///< If size is zero, then the driver shall update the value with the total + ///< size in bytes needed. + ///< If size is less than the total size needed, then the driver shall + ///< update the value with the required size and shall not write to pData. + void* pData ///< [in,out][optional][range(0, *pSize)] pointer to the result buffer. + ///< If pData is nullptr, then only the required size is returned in pSize. + ) + { + context.logger->log_trace("zeDeviceGetCompilerInfo(hDevice, paramName, pNext, pSize, pData)"); + + auto pfnGetCompilerInfo = context.zeDdiTable.Device.pfnGetCompilerInfo; + + if( nullptr == pfnGetCompilerInfo ) + return logAndPropagateResult_zeDeviceGetCompilerInfo(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, paramName, pNext, pSize, pData); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetCompilerInfoPrologue( hDevice, paramName, pNext, pSize, pData ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetCompilerInfo(result, hDevice, paramName, pNext, pSize, pData); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zeHandleLifetime.zeDeviceGetCompilerInfoPrologue( hDevice, paramName, pNext, pSize, pData ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetCompilerInfo(result, hDevice, paramName, pNext, pSize, pData); + } + + auto driver_result = pfnGetCompilerInfo( hDevice, paramName, pNext, pSize, pData ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zeValidation->zeDeviceGetCompilerInfoEpilogue( hDevice, paramName, pNext, pSize, pData ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zeDeviceGetCompilerInfo(result, hDevice, paramName, pNext, pSize, pData); + } + + return logAndPropagateResult_zeDeviceGetCompilerInfo(driver_result, hDevice, paramName, pNext, pSize, pData); + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zexCounterBasedEventCreate2 __zedlllocal ze_result_t ZE_APICALL zexCounterBasedEventCreate2( @@ -20334,6 +20979,10 @@ zeGetDeviceProcAddrTable( dditable.pfnGetCounterBasedEventMaxValue = pDdiTable->pfnGetCounterBasedEventMaxValue; pDdiTable->pfnGetCounterBasedEventMaxValue = validation_layer::zeDeviceGetCounterBasedEventMaxValue; } + if (version >= ZE_API_VERSION_1_18) { + dditable.pfnGetCompilerInfo = pDdiTable->pfnGetCompilerInfo; + pDdiTable->pfnGetCompilerInfo = validation_layer::zeDeviceGetCompilerInfo; + } if (version >= ZE_API_VERSION_1_2) { dditable.pfnReserveCacheExt = pDdiTable->pfnReserveCacheExt; pDdiTable->pfnReserveCacheExt = validation_layer::zeDeviceReserveCacheExt; @@ -20499,6 +21148,10 @@ zeGetCommandQueueProcAddrTable( dditable.pfnGetPriority = pDdiTable->pfnGetPriority; pDdiTable->pfnGetPriority = validation_layer::zeCommandQueueGetPriority; } + if (version >= ZE_API_VERSION_1_18) { + dditable.pfnSetPriorityExt = pDdiTable->pfnSetPriorityExt; + pDdiTable->pfnSetPriorityExt = validation_layer::zeCommandQueueSetPriorityExt; + } if (version >= ZE_API_VERSION_1_9) { dditable.pfnGetOrdinal = pDdiTable->pfnGetOrdinal; pDdiTable->pfnGetOrdinal = validation_layer::zeCommandQueueGetOrdinal; @@ -20710,6 +21363,14 @@ zeGetCommandListProcAddrTable( dditable.pfnAppendHostFunction = pDdiTable->pfnAppendHostFunction; pDdiTable->pfnAppendHostFunction = validation_layer::zeCommandListAppendHostFunction; } + if (version >= ZE_API_VERSION_1_18) { + dditable.pfnAppendSignalEventWithParameters = pDdiTable->pfnAppendSignalEventWithParameters; + pDdiTable->pfnAppendSignalEventWithParameters = validation_layer::zeCommandListAppendSignalEventWithParameters; + } + if (version >= ZE_API_VERSION_1_18) { + dditable.pfnAppendWaitOnEventsWithParameters = pDdiTable->pfnAppendWaitOnEventsWithParameters; + pDdiTable->pfnAppendWaitOnEventsWithParameters = validation_layer::zeCommandListAppendWaitOnEventsWithParameters; + } if (version >= ZE_API_VERSION_1_3) { dditable.pfnAppendImageCopyToMemoryExt = pDdiTable->pfnAppendImageCopyToMemoryExt; pDdiTable->pfnAppendImageCopyToMemoryExt = validation_layer::zeCommandListAppendImageCopyToMemoryExt; @@ -21198,6 +21859,10 @@ zeGetKernelProcAddrTable( dditable.pfnGetName = pDdiTable->pfnGetName; pDdiTable->pfnGetName = validation_layer::zeKernelGetName; } + if (version >= ZE_API_VERSION_1_18) { + dditable.pfnGetModuleHandle = pDdiTable->pfnGetModuleHandle; + pDdiTable->pfnGetModuleHandle = validation_layer::zeKernelGetModuleHandle; + } return result; } @@ -21422,6 +22087,10 @@ zeGetModuleProcAddrTable( dditable.pfnGetFunctionPointer = pDdiTable->pfnGetFunctionPointer; pDdiTable->pfnGetFunctionPointer = validation_layer::zeModuleGetFunctionPointer; } + if (version >= ZE_API_VERSION_1_18) { + dditable.pfnGetDeviceHandle = pDdiTable->pfnGetDeviceHandle; + pDdiTable->pfnGetDeviceHandle = validation_layer::zeModuleGetDeviceHandle; + } if (version >= ZE_API_VERSION_1_3) { dditable.pfnInspectLinkageExt = pDdiTable->pfnInspectLinkageExt; pDdiTable->pfnInspectLinkageExt = validation_layer::zeModuleInspectLinkageExt; @@ -21762,6 +22431,18 @@ zeGetGraphProcAddrTable( dditable.pfnDestroyExt = pDdiTable->pfnDestroyExt; pDdiTable->pfnDestroyExt = validation_layer::zeGraphDestroyExt; } + if (version >= ZE_API_VERSION_1_18) { + dditable.pfnPauseCaptureExt = pDdiTable->pfnPauseCaptureExt; + pDdiTable->pfnPauseCaptureExt = validation_layer::zeGraphPauseCaptureExt; + } + if (version >= ZE_API_VERSION_1_18) { + dditable.pfnResumeCaptureExt = pDdiTable->pfnResumeCaptureExt; + pDdiTable->pfnResumeCaptureExt = validation_layer::zeGraphResumeCaptureExt; + } + if (version >= ZE_API_VERSION_1_18) { + dditable.pfnGetIdExt = pDdiTable->pfnGetIdExt; + pDdiTable->pfnGetIdExt = validation_layer::zeGraphGetIdExt; + } return result; } diff --git a/source/layers/validation/zes_valddi.cpp b/source/layers/validation/zes_valddi.cpp index 73e91307..39d8827f 100644 --- a/source/layers/validation/zes_valddi.cpp +++ b/source/layers/validation/zes_valddi.cpp @@ -28,8 +28,8 @@ namespace validation_layer // Generate specific logAndPropagateResult functions for each API function VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zesInit( ze_result_t result, - zes_init_flags_t flags ///< [in] initialization flags. - ///< currently unused, must be 0 (default). + zes_init_flags_t flags ///< [in] initialization flags. This should be 0 or a combination of + ///< ::zes_init_flags_t values. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -3097,8 +3097,10 @@ namespace validation_layer VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zesPowerGetUsage( ze_result_t result, zes_pwr_handle_t hPower, ///< [in] Handle of the power domain. - uint32_t* pInstantPower, ///< [out] Returns the instant power usage in milliwatts. - uint32_t* pAveragePower ///< [out] Returns the average power usage in milliwatts. + uint32_t* pInstantPower, ///< [out][optional] Returns the instant power usage in milliwatts. If this + ///< is `nullptr`, the instant power usage will not be returned. + uint32_t* pAveragePower ///< [out][optional] Returns the average power usage in milliwatts. If this + ///< is `nullptr`, the average power usage will not be returned. ) { // Only log success results if verbose logging is enabled if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { @@ -4748,13 +4750,66 @@ namespace validation_layer context.logger->log_trace(oss.str()); return result; } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zesDeviceGetHealthStatusExt( + ze_result_t result, + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_health_status_ext_t* pHealth ///< [out] Current health status of the device. +) { + // Only log success results if verbose logging is enabled + if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { + return result; + } + std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; + std::ostringstream oss; + oss << status << " (" << loader::to_string(result) << ") in zesDeviceGetHealthStatusExt("; + + + oss << "hDevice="; + oss << loader::to_string(hDevice); + + oss << ", "; + oss << "pHealth="; + // Dereference output parameter if not null and result is success + if (result == ZE_RESULT_SUCCESS && pHealth != nullptr) { + oss << loader::to_string(*pHealth); + } else { + oss << loader::to_string(pHealth); + } + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } + VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zesDeviceSetHealthStatusExt( + ze_result_t result, + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_health_status_ext_t health ///< [in] New health status to be set for the device. +) { + // Only log success results if verbose logging is enabled + if (result == ZE_RESULT_SUCCESS && !context.verboseLogging) { + return result; + } + std::string status = (result == ZE_RESULT_SUCCESS) ? "SUCCESS" : "ERROR"; + std::ostringstream oss; + oss << status << " (" << loader::to_string(result) << ") in zesDeviceSetHealthStatusExt("; + + + oss << "hDevice="; + oss << loader::to_string(hDevice); + + oss << ", "; + oss << "health="; + oss << loader::to_string(health); + oss << ")"; + context.logger->log_trace(oss.str()); + return result; + } /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zesInit __zedlllocal ze_result_t ZE_APICALL zesInit( - zes_init_flags_t flags ///< [in] initialization flags. - ///< currently unused, must be 0 (default). + zes_init_flags_t flags ///< [in] initialization flags. This should be 0 or a combination of + ///< ::zes_init_flags_t values. ) { context.logger->log_trace("zesInit(flags)"); @@ -9380,8 +9435,10 @@ namespace validation_layer __zedlllocal ze_result_t ZE_APICALL zesPowerGetUsage( zes_pwr_handle_t hPower, ///< [in] Handle of the power domain. - uint32_t* pInstantPower, ///< [out] Returns the instant power usage in milliwatts. - uint32_t* pAveragePower ///< [out] Returns the average power usage in milliwatts. + uint32_t* pInstantPower, ///< [out][optional] Returns the instant power usage in milliwatts. If this + ///< is `nullptr`, the instant power usage will not be returned. + uint32_t* pAveragePower ///< [out][optional] Returns the average power usage in milliwatts. If this + ///< is `nullptr`, the average power usage will not be returned. ) { context.logger->log_trace("zesPowerGetUsage(hPower, pInstantPower, pAveragePower)"); @@ -11878,6 +11935,90 @@ namespace validation_layer return logAndPropagateResult_zesDevicePciLinkSpeedUpdateExt(driver_result, hDevice, shouldDowngrade, pendingAction); } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceGetHealthStatusExt + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGetHealthStatusExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_health_status_ext_t* pHealth ///< [out] Current health status of the device. + ) + { + context.logger->log_trace("zesDeviceGetHealthStatusExt(hDevice, pHealth)"); + + auto pfnGetHealthStatusExt = context.zesDdiTable.Device.pfnGetHealthStatusExt; + + if( nullptr == pfnGetHealthStatusExt ) + return logAndPropagateResult_zesDeviceGetHealthStatusExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, pHealth); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zesValidation->zesDeviceGetHealthStatusExtPrologue( hDevice, pHealth ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesDeviceGetHealthStatusExt(result, hDevice, pHealth); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zesHandleLifetime.zesDeviceGetHealthStatusExtPrologue( hDevice, pHealth ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesDeviceGetHealthStatusExt(result, hDevice, pHealth); + } + + auto driver_result = pfnGetHealthStatusExt( hDevice, pHealth ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zesValidation->zesDeviceGetHealthStatusExtEpilogue( hDevice, pHealth ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesDeviceGetHealthStatusExt(result, hDevice, pHealth); + } + + return logAndPropagateResult_zesDeviceGetHealthStatusExt(driver_result, hDevice, pHealth); + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceSetHealthStatusExt + __zedlllocal ze_result_t ZE_APICALL + zesDeviceSetHealthStatusExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_health_status_ext_t health ///< [in] New health status to be set for the device. + ) + { + context.logger->log_trace("zesDeviceSetHealthStatusExt(hDevice, health)"); + + auto pfnSetHealthStatusExt = context.zesDdiTable.Device.pfnSetHealthStatusExt; + + if( nullptr == pfnSetHealthStatusExt ) + return logAndPropagateResult_zesDeviceSetHealthStatusExt(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, hDevice, health); + + auto numValHandlers = context.validationHandlers.size(); + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zesValidation->zesDeviceSetHealthStatusExtPrologue( hDevice, health ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesDeviceSetHealthStatusExt(result, hDevice, health); + } + + + if( context.enableThreadingValidation ){ + //Unimplemented + } + + + if(context.enableHandleLifetime ){ + auto result = context.handleLifetime->zesHandleLifetime.zesDeviceSetHealthStatusExtPrologue( hDevice, health ); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesDeviceSetHealthStatusExt(result, hDevice, health); + } + + auto driver_result = pfnSetHealthStatusExt( hDevice, health ); + + for (size_t i = 0; i < numValHandlers; i++) { + auto result = context.validationHandlers[i]->zesValidation->zesDeviceSetHealthStatusExtEpilogue( hDevice, health ,driver_result); + if(result!=ZE_RESULT_SUCCESS) return logAndPropagateResult_zesDeviceSetHealthStatusExt(result, hDevice, health); + } + + return logAndPropagateResult_zesDeviceSetHealthStatusExt(driver_result, hDevice, health); + } + } // namespace validation_layer #if defined(__cplusplus) @@ -12043,6 +12184,14 @@ zesGetDeviceProcAddrTable( dditable.pfnPciLinkSpeedUpdateExt = pDdiTable->pfnPciLinkSpeedUpdateExt; pDdiTable->pfnPciLinkSpeedUpdateExt = validation_layer::zesDevicePciLinkSpeedUpdateExt; } + if (version >= ZE_API_VERSION_1_18) { + dditable.pfnGetHealthStatusExt = pDdiTable->pfnGetHealthStatusExt; + pDdiTable->pfnGetHealthStatusExt = validation_layer::zesDeviceGetHealthStatusExt; + } + if (version >= ZE_API_VERSION_1_18) { + dditable.pfnSetHealthStatusExt = pDdiTable->pfnSetHealthStatusExt; + pDdiTable->pfnSetHealthStatusExt = validation_layer::zesDeviceSetHealthStatusExt; + } if (version >= ZE_API_VERSION_1_4) { dditable.pfnEccAvailable = pDdiTable->pfnEccAvailable; pDdiTable->pfnEccAvailable = validation_layer::zesDeviceEccAvailable; diff --git a/source/lib/ze_libapi.cpp b/source/lib/ze_libapi.cpp index 5fa9a6ed..fc4eba5f 100644 --- a/source/lib/ze_libapi.cpp +++ b/source/lib/ze_libapi.cpp @@ -5963,7 +5963,6 @@ zeEventCreate( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE /// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE /// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS /// - ::ZE_RESULT_ERROR_NOT_AVAILABLE @@ -5977,12 +5976,15 @@ zeEventCreate( /// + `nullptr == desc` /// + `nullptr == phEvent` /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x7f < desc->flags` +/// + `0xff < desc->flags` /// + `0x7 < desc->signal` /// + `0x7 < desc->wait` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT /// + `completionValue` provided in `pNext` ::ze_event_counter_based_external_sync_allocation_desc_t or ::ze_event_counter_based_external_aggregate_storage_desc_t exceeds the value returned by ::zeDeviceGetCounterBasedEventMaxValue +/// + ::ZE_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL is set without ::ZE_EVENT_COUNTER_BASED_FLAG_IPC +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + ::ZE_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL is set and the implementation does not provide bi-directional IPC sharing ze_result_t ZE_APICALL zeEventCounterBasedCreate( ze_context_handle_t hContext, ///< [in] handle of the context object @@ -6383,6 +6385,17 @@ zeEventPoolCloseIpcHandle( /// @brief Gets an IPC counter based event handle that can be shared with another /// process. /// +/// @details +/// - When the event was created with +/// ::ZE_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL, it may be shared +/// before it is enqueued for signaling for the first time, and the +/// returned handle remains valid after the event state is replaced by a +/// signal operation. It does not have to be obtained again. +/// - Without that flag, a handle represents the state captured at the time +/// of this call. A new handle must be obtained every time the state is +/// replaced, and this function returns ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// for an event that has not been enqueued for signaling yet. +/// /// @returns /// - ::ZE_RESULT_SUCCESS /// - ::ZE_RESULT_ERROR_UNINITIALIZED @@ -6445,6 +6458,22 @@ zeEventCounterBasedGetIpcHandle( /// @brief Opens an IPC event handle to retrieve from another process. /// /// @details +/// - IPC sharing is bi-directional when the exported event was created with +/// ::ZE_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL. The opened event then +/// refers to the same synchronization point as the event in the exporting +/// process and may be used for waiting, querying and signaling. Without +/// that flag the opened event holds the state captured when its handle +/// was obtained, may be used only for waiting and querying, and must be +/// opened again every time the state is replaced in the exporting +/// process. +/// - With bi-directional sharing, the opened event remains valid after its +/// state is replaced by a signal operation performed in either process. +/// It does not have to be opened again, and both processes observe the +/// latest state. +/// - With bi-directional sharing, the application must keep both processes +/// alive for as long as the opened event is used. Waiting on, querying or +/// signaling the event after the process that produced the latest state +/// has exited results in undefined behavior. /// - The `hContext` parameter has no requirement to match the context that /// was used to create the event in the exporting process. Any context of /// the importing process may be used, including the driver's default @@ -6454,8 +6483,9 @@ zeEventCounterBasedGetIpcHandle( /// signaling, no device is yet associated with it; if the event has been /// enqueued for signaling, it is associated with the device performing /// that signal operation. -/// - Any device of the importing process may signal the opened event. -/// Enqueuing a signal operation overwrites the previous tracking point. +/// - With bi-directional sharing, any device of the importing process may +/// signal the opened event. Enqueuing a signal operation overwrites the +/// previous tracking point. /// - A device may wait on the opened event only if it has P2P access to the /// device associated with the current tracking point. The set of devices /// that may wait therefore depends on the P2P capabilities relative to @@ -6467,7 +6497,6 @@ zeEventCounterBasedGetIpcHandle( /// - ::ZE_RESULT_ERROR_DEVICE_LOST /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE /// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE /// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS /// - ::ZE_RESULT_ERROR_NOT_AVAILABLE @@ -6479,6 +6508,8 @@ zeEventCounterBasedGetIpcHandle( /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == phEvent` /// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + the handle was exported by an event created with ::ZE_EVENT_COUNTER_BASED_FLAG_IPC_BIDIRECTIONAL and the implementation does not provide bi-directional IPC sharing ze_result_t ZE_APICALL zeEventCounterBasedOpenIpcHandle( ze_context_handle_t hContext, ///< [in] handle of the context object to associate with the IPC event @@ -6665,6 +6696,8 @@ zeEventCounterBasedGetDeviceAddress( /// - The application must **not** call this function from simultaneous /// threads with the same command list handle. /// - The implementation of this function should be lock-free. +/// - Passing additional parameters is possible with +/// ::zeCommandListAppendSignalEventWithParameters function. /// /// @remarks /// _Analogues_ @@ -6728,6 +6761,95 @@ zeCommandListAppendSignalEvent( #endif } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Appends a signal of the event from the device into a command list and +/// allows to pass additional parameters. +/// +/// @details +/// - The application must ensure the events are accessible by the device on +/// which the command list was created. This requirement does not apply to +/// counter-based events. +/// - For counter-based events, the event may be signaled on any device, +/// regardless of the device used to create the event. When a +/// counter-based event is passed for signaling, it drops its previous +/// tracking point and re-associates with the device on which the command +/// list was created, tracking the new signaling point. No peer-to-peer +/// access between the previously associated device and the new signaling +/// device is required. +/// - The duration of an event created from an event pool that was created +/// using ::ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP or +/// ::ZE_EVENT_POOL_FLAG_KERNEL_MAPPED_TIMESTAMP flags is undefined. +/// However, for consistency and orthogonality the event will report +/// correctly as signaled when used by other event API functionality. +/// - The application must ensure the command list and events were created +/// on the same context. +/// - The application must **not** call this function from simultaneous +/// threads with the same command list handle. +/// - The implementation of this function should be lock-free. +/// - This function allows to pass additional parameters in the form of +/// ::ze_base_desc_t . +/// - This function acts like ::zeCommandListAppendSignalEvent when passing +/// `NULL` value to `pNext`. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` +/// + `nullptr == hEvent` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + when passed additional parameters are invalid or incompatible with the device or command list +ze_result_t ZE_APICALL +zeCommandListAppendSignalEventWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + ze_event_handle_t hEvent ///< [in] handle of the event + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnCommandListAppendSignalEventWithParameters_t pfnAppendSignalEventWithParameters = [&result] { + auto pfnAppendSignalEventWithParameters = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendSignalEventWithParameters; + if( nullptr == pfnAppendSignalEventWithParameters ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnAppendSignalEventWithParameters; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnAppendSignalEventWithParameters( hCommandList, pNext, hEvent ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnAppendSignalEventWithParameters = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendSignalEventWithParameters; + if( nullptr == pfnAppendSignalEventWithParameters ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnAppendSignalEventWithParameters( hCommandList, pNext, hEvent ); + #endif +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Appends wait on event(s) on the device into a command list. /// @@ -6743,6 +6865,8 @@ zeCommandListAppendSignalEvent( /// - The application must **not** call this function from simultaneous /// threads with the same command list handle. /// - The implementation of this function should be lock-free. +/// - Passing additional parameters is possible with +/// ::zeCommandListAppendWaitOnEventsWithParameters function. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -6804,6 +6928,89 @@ zeCommandListAppendWaitOnEvents( #endif } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Appends wait on event(s) on the device into a command list and allows +/// to pass additional parameters. +/// +/// @details +/// - The application must ensure the events are accessible by the device on +/// which the command list was created. +/// - For counter-based events, the device on which the command list was +/// created must have peer-to-peer access to the device that last signaled +/// the event. Unlike signaling, waiting on a counter-based event does not +/// re-associate it with another device. +/// - The application must ensure the command list and events were created +/// on the same context. +/// - The application must **not** call this function from simultaneous +/// threads with the same command list handle. +/// - The implementation of this function should be lock-free. +/// - This function allows to pass additional parameters in the form of +/// ::ze_base_desc_t . +/// - This function acts like ::zeCommandListAppendWaitOnEvents when passing +/// `NULL` value to `pNext`. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandList` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phEvents` +/// - ::ZE_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + when passed additional parameters are invalid or incompatible with the device or command list +ze_result_t ZE_APICALL +zeCommandListAppendWaitOnEventsWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + uint32_t numEvents, ///< [in] number of events to wait on before continuing + ze_event_handle_t* phEvents ///< [in][range(0, numEvents)] handles of the events to wait on before + ///< continuing + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnCommandListAppendWaitOnEventsWithParameters_t pfnAppendWaitOnEventsWithParameters = [&result] { + auto pfnAppendWaitOnEventsWithParameters = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendWaitOnEventsWithParameters; + if( nullptr == pfnAppendWaitOnEventsWithParameters ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnAppendWaitOnEventsWithParameters; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnAppendWaitOnEventsWithParameters( hCommandList, pNext, numEvents, phEvents ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnAppendWaitOnEventsWithParameters = ze_lib::context->zeDdiTable.load()->CommandList.pfnAppendWaitOnEventsWithParameters; + if( nullptr == pfnAppendWaitOnEventsWithParameters ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnAppendWaitOnEventsWithParameters( hCommandList, pNext, numEvents, phEvents ); + #endif +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Signals a event from host. /// @@ -8779,7 +8986,10 @@ zeMemGetAddressRange( /// mapping is required in the sending process. /// - Only one physical memory object may be associated with a single IPC /// handle at a time; the virtual address range passed must map to exactly -/// one physical memory object. +/// one physical memory object, unless a +/// ::ze_ipc_phys_mem_handle_range_ext_desc_t is chained via `pNext` to +/// capture a range spanning multiple physical memory objects into a +/// single IPC handle. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// @@ -8990,6 +9200,11 @@ zeMemGetFileDescriptorFromIpcHandleExp( /// the IPC handle. /// For instance, it may close the file descriptor contained in the IPC /// handle, if such type of handle is being used by the driver. +/// - When the IPC handle encodes multiple physical memory objects (for +/// example, a handle representing a range of objects), the driver +/// releases **all** of the underlying resources it holds for that handle, +/// not just one; for instance, it closes every file descriptor the driver +/// opened to represent the encoded objects. /// - This call does not free the original allocation for which the IPC /// handle was created. /// - This function may **not** be called from simultaneous threads with the @@ -9155,6 +9370,16 @@ zeMemOpenIpcHandle( /// @details /// - Closes an IPC memory handle by unmapping memory that was opened in /// this process using ::zeMemOpenIpcHandle. +/// - `ptr` must be the base pointer returned by ::zeMemOpenIpcHandle; +/// passing an interior address is not valid. +/// - This call unmaps every physical memory object that +/// ::zeMemOpenIpcHandle mapped for this pointer and frees any virtual +/// address reservation the driver created on the caller's behalf to back +/// it. When the handle encoded a range of multiple physical objects, all +/// of those objects are unmapped by this single call. The application +/// never reserved this address range and must not attempt to release it +/// with ::zeVirtualMemFree; this call leaves no mappings or virtual +/// address reservation behind. /// - The application must **not** call this function from simultaneous /// threads with the same pointer. /// - The implementation of this function must be thread-safe. @@ -10034,6 +10259,69 @@ zeModuleGetProperties( #endif } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieve the handle of the device on which the module was created. +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hModule` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phDevice` +ze_result_t ZE_APICALL +zeModuleGetDeviceHandle( + ze_module_handle_t hModule, ///< [in] handle of the module + ze_device_handle_t* phDevice ///< [out] handle of the device the module was created for + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnModuleGetDeviceHandle_t pfnGetDeviceHandle = [&result] { + auto pfnGetDeviceHandle = ze_lib::context->zeDdiTable.load()->Module.pfnGetDeviceHandle; + if( nullptr == pfnGetDeviceHandle ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnGetDeviceHandle; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnGetDeviceHandle( hModule, phDevice ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnGetDeviceHandle = ze_lib::context->zeDdiTable.load()->Module.pfnGetDeviceHandle; + if( nullptr == pfnGetDeviceHandle ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnGetDeviceHandle( hModule, phDevice ); + #endif +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Create a kernel from the module. /// @@ -10945,6 +11233,69 @@ zeKernelGetName( #endif } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieve the handle of the module from which the kernel was created. +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hKernel` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == phModule` +ze_result_t ZE_APICALL +zeKernelGetModuleHandle( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel + ze_module_handle_t* phModule ///< [out] handle of the module the kernel was created from + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnKernelGetModuleHandle_t pfnGetModuleHandle = [&result] { + auto pfnGetModuleHandle = ze_lib::context->zeDdiTable.load()->Kernel.pfnGetModuleHandle; + if( nullptr == pfnGetModuleHandle ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnGetModuleHandle; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnGetModuleHandle( hKernel, phModule ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnGetModuleHandle = ze_lib::context->zeDdiTable.load()->Kernel.pfnGetModuleHandle; + if( nullptr == pfnGetModuleHandle ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnGetModuleHandle( hKernel, phModule ); + #endif +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Launch kernel over one or more work groups. /// @@ -11041,10 +11392,10 @@ zeCommandListAppendLaunchKernel( /// same command list handle. /// - The implementation of this function should be lock-free. /// - This function allows to pass additional parameters in the form of -/// `${x}_base_desc_t` +/// ::ze_base_desc_t . /// - This function can replace ::zeCommandListAppendLaunchCooperativeKernel /// with additional parameter -/// `${x}_command_list_append_launch_kernel_param_cooperative_desc_t` +/// ::ze_command_list_append_launch_kernel_param_cooperative_desc_t . /// - This function supports both immediate and regular command lists. /// /// @returns @@ -11132,10 +11483,10 @@ zeCommandListAppendLaunchKernelWithParameters( /// - The implementation of this function should be lock-free. /// - This function supports both immediate and regular command lists. /// - This function changes kernel state as if separate -/// ${x}KernelSetGroupSize and ${x}KernelSetArgumentValue functions were +/// ::zeKernelSetGroupSize and ::zeKernelSetArgumentValue functions were /// called. /// - This function allows to pass additional extensions in the form of -/// `${x}_base_desc_t` +/// ::ze_base_desc_t . /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -11158,8 +11509,8 @@ zeCommandListAppendLaunchKernelWithParameters( /// + `(nullptr == phWaitEvents) && (0 < numWaitEvents)` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE /// + when passed additional extensions are invalid or incompatible with the device or command list -/// - ::ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION - "as per ${x}KernelSetGroupSize" -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT - "as per ${x}KernelSetArgumentValue" +/// - ::ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION - as per ::zeKernelSetGroupSize +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT - as per ::zeKernelSetArgumentValue ze_result_t ZE_APICALL zeCommandListAppendLaunchKernelWithArguments( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list @@ -17275,7 +17626,10 @@ zeKernelGetAllocationPropertiesExp( /// handle represents the underlying physical memory object. /// - Only one physical memory object may be associated with a single IPC /// handle at a time; the virtual address range passed must map to exactly -/// one physical memory object. +/// one physical memory object, unless a +/// ::ze_ipc_phys_mem_handle_range_ext_desc_t is chained via `pNext` to +/// capture a range spanning multiple physical memory objects into a +/// single IPC handle. /// - The application may call this function from simultaneous threads. /// - The implementation of this function must be thread-safe. /// @@ -17711,9 +18065,9 @@ zeCommandListIsGraphCaptureEnabledExt( /// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == phGraph` -/// - $ZE_RESULT_ERROR_GRAPH_UNJOINED_FORKS +/// - ::ZE_RESULT_ERROR_GRAPH_UNJOINED_FORKS /// + if graph contains unjoined forks -/// - $ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING +/// - ::ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING /// + if command list is not in graph capture mode ze_result_t ZE_APICALL zeCommandListEndGraphCaptureExt( @@ -17787,7 +18141,7 @@ zeCommandListEndGraphCaptureExt( /// + `nullptr == hCommandList` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == phGraph` -/// - $ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING +/// - ::ZE_RESULT_ERROR_COMMAND_LIST_NOT_CAPTURING /// + if command list is not in graph capture mode ze_result_t ZE_APICALL zeCommandListGetGraphExt( @@ -17989,6 +18343,11 @@ zeGraphSetDestructionCallbackExt( /// - Resources used in captured commands (e.g. buffers passed to kernels as /// arguments) are shared between instances; the application is /// responsible for avoiding data races during concurrent execution. +/// - The function returns `ZE_RESULT_ERROR_INVALID_GRAPH` when the recorded +/// graph is invalid, for example when it contains forks that were never +/// joined back to the primary command list. +/// - The function returns `ZE_RESULT_ERROR_INVALID_ARGUMENT` when graph +/// capture has not been ended with ::zeCommandListEndGraphCaptureExt. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -18008,6 +18367,7 @@ zeGraphSetDestructionCallbackExt( /// + `nullptr == hGraph` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// + `nullptr == phExecutableGraph` +/// - ::ZE_RESULT_ERROR_INVALID_GRAPH ze_result_t ZE_APICALL zeGraphInstantiateExt( ze_graph_handle_t hGraph, ///< [in] handle of the recorded graph @@ -18451,6 +18811,185 @@ zeGraphDestroyExt( #endif } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Pauses recording to the specified graph. Affected immediate command +/// lists (both primary command lists and child command lists from which +/// graph was recording) can be reused for any purpose during this pause +/// without affecting the paused recording. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hGraph` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + Graph is not in a recording state +ze_result_t ZE_APICALL +zeGraphPauseCaptureExt( + ze_graph_handle_t hGraph ///< [in] handle to the graph to pause capture + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnGraphPauseCaptureExt_t pfnPauseCaptureExt = [&result] { + auto pfnPauseCaptureExt = ze_lib::context->zeDdiTable.load()->Graph.pfnPauseCaptureExt; + if( nullptr == pfnPauseCaptureExt ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnPauseCaptureExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnPauseCaptureExt( hGraph ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnPauseCaptureExt = ze_lib::context->zeDdiTable.load()->Graph.pfnPauseCaptureExt; + if( nullptr == pfnPauseCaptureExt ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnPauseCaptureExt( hGraph ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Resumes capturing commands to the graph after a pause. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hGraph` +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// + Graph is not in a paused state +ze_result_t ZE_APICALL +zeGraphResumeCaptureExt( + ze_graph_handle_t hGraph ///< [in] handle to the graph to resume capture + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnGraphResumeCaptureExt_t pfnResumeCaptureExt = [&result] { + auto pfnResumeCaptureExt = ze_lib::context->zeDdiTable.load()->Graph.pfnResumeCaptureExt; + if( nullptr == pfnResumeCaptureExt ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnResumeCaptureExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnResumeCaptureExt( hGraph ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnResumeCaptureExt = ze_lib::context->zeDdiTable.load()->Graph.pfnResumeCaptureExt; + if( nullptr == pfnResumeCaptureExt ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnResumeCaptureExt( hGraph ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Gets monotonically increasing, process-unique ID of the graph. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hGraph` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pGraphId` +ze_result_t ZE_APICALL +zeGraphGetIdExt( + ze_graph_handle_t hGraph, ///< [in] handle to the graph + uint64_t* pGraphId ///< [out] pointer to the memory where the graph ID will be written + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnGraphGetIdExt_t pfnGetIdExt = [&result] { + auto pfnGetIdExt = ze_lib::context->zeDdiTable.load()->Graph.pfnGetIdExt; + if( nullptr == pfnGetIdExt ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnGetIdExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnGetIdExt( hGraph, pGraphId ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnGetIdExt = ze_lib::context->zeDdiTable.load()->Graph.pfnGetIdExt; + if( nullptr == pfnGetIdExt ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnGetIdExt( hGraph, pGraphId ); + #endif +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Appends a host function call into a command list. /// @@ -18540,4 +19079,155 @@ zeCommandListAppendHostFunction( #endif } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Sets the priority of a command queue. +/// +/// @details +/// - The application may call this function from simultaneous threads. +/// - This function changes the priority of an existing command queue, +/// overriding the priority specified at creation through +/// ::ze_command_queue_desc_t; the updated value is reported by +/// ::zeCommandQueueGetPriority. +/// - Whether the new priority affects commands already submitted to the +/// command queue, or only commands submitted after this call, is +/// implementation-defined. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hCommandQueue` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_HIGH < priority` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +ze_result_t ZE_APICALL +zeCommandQueueSetPriorityExt( + ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t priority ///< [in] priority to set for the command queue + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnCommandQueueSetPriorityExt_t pfnSetPriorityExt = [&result] { + auto pfnSetPriorityExt = ze_lib::context->zeDdiTable.load()->CommandQueue.pfnSetPriorityExt; + if( nullptr == pfnSetPriorityExt ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnSetPriorityExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnSetPriorityExt( hCommandQueue, priority ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnSetPriorityExt = ze_lib::context->zeDdiTable.load()->CommandQueue.pfnSetPriorityExt; + if( nullptr == pfnSetPriorityExt ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnSetPriorityExt( hCommandQueue, priority ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieves compiler-specific information for the device, selected by an +/// enumerated type. +/// +/// @details +/// - This query is scoped to compiler-specific data. +/// - The paramName parameter selects data to be queried. Data layout is +/// documented along with respective paramName enum entry. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZE_DEVICE_COMPILER_INFO_DRIVER_OPTIONS < paramName` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pSize` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + an extension passed via pNext is not supported +ze_result_t ZE_APICALL +zeDeviceGetCompilerInfo( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_device_compiler_info_t paramName, ///< [in] compiler-info to return + const void* pNext, ///< [in][optional] additional extensions passed to the function + size_t* pSize, ///< [in,out] pointer to the size in bytes of the result. + ///< If size is zero, then the driver shall update the value with the total + ///< size in bytes needed. + ///< If size is less than the total size needed, then the driver shall + ///< update the value with the required size and shall not write to pData. + void* pData ///< [in,out][optional][range(0, *pSize)] pointer to the result buffer. + ///< If pData is nullptr, then only the required size is returned in pSize. + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const ze_pfnDeviceGetCompilerInfo_t pfnGetCompilerInfo = [&result] { + auto pfnGetCompilerInfo = ze_lib::context->zeDdiTable.load()->Device.pfnGetCompilerInfo; + if( nullptr == pfnGetCompilerInfo ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnGetCompilerInfo; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnGetCompilerInfo( hDevice, paramName, pNext, pSize, pData ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnGetCompilerInfo = ze_lib::context->zeDdiTable.load()->Device.pfnGetCompilerInfo; + if( nullptr == pfnGetCompilerInfo ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnGetCompilerInfo( hDevice, paramName, pNext, pSize, pData ); + #endif +} + } // extern "C" diff --git a/source/lib/ze_libddi.cpp b/source/lib/ze_libddi.cpp index 32dd9451..2bd90348 100644 --- a/source/lib/ze_libddi.cpp +++ b/source/lib/ze_libddi.cpp @@ -186,6 +186,8 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeDeviceValidateRuntimeRequirements") ); initialzeDdiTable.Device.pfnGetCounterBasedEventMaxValue = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeDeviceGetCounterBasedEventMaxValue") ); + initialzeDdiTable.Device.pfnGetCompilerInfo = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeDeviceGetCompilerInfo") ); initialzeDdiTable.Device.pfnReserveCacheExt = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeDeviceReserveCacheExt") ); initialzeDdiTable.Device.pfnSetCacheAdviceExt = reinterpret_cast( @@ -250,6 +252,8 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeCommandQueueGetMode") ); initialzeDdiTable.CommandQueue.pfnGetPriority = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeCommandQueueGetPriority") ); + initialzeDdiTable.CommandQueue.pfnSetPriorityExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeCommandQueueSetPriorityExt") ); initialzeDdiTable.CommandQueue.pfnGetOrdinal = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeCommandQueueGetOrdinal") ); initialzeDdiTable.CommandQueue.pfnGetIndex = reinterpret_cast( @@ -349,6 +353,10 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeCommandListAppendGraphExt") ); initialzeDdiTable.CommandList.pfnAppendHostFunction = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeCommandListAppendHostFunction") ); + initialzeDdiTable.CommandList.pfnAppendSignalEventWithParameters = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeCommandListAppendSignalEventWithParameters") ); + initialzeDdiTable.CommandList.pfnAppendWaitOnEventsWithParameters = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeCommandListAppendWaitOnEventsWithParameters") ); initialzeDdiTable.CommandList.pfnAppendImageCopyToMemoryExt = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeCommandListAppendImageCopyToMemoryExt") ); initialzeDdiTable.CommandList.pfnAppendImageCopyFromMemoryExt = reinterpret_cast( @@ -544,6 +552,8 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeKernelGetProperties") ); initialzeDdiTable.Kernel.pfnGetName = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeKernelGetName") ); + initialzeDdiTable.Kernel.pfnGetModuleHandle = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeKernelGetModuleHandle") ); } if( ZE_RESULT_SUCCESS == result ) @@ -632,6 +642,8 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeModuleGetProperties") ); initialzeDdiTable.Module.pfnGetFunctionPointer = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeModuleGetFunctionPointer") ); + initialzeDdiTable.Module.pfnGetDeviceHandle = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeModuleGetDeviceHandle") ); initialzeDdiTable.Module.pfnInspectLinkageExt = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeModuleInspectLinkageExt") ); } @@ -754,6 +766,12 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zeGraphDumpContentsExt") ); initialzeDdiTable.Graph.pfnDestroyExt = reinterpret_cast( GET_FUNCTION_PTR(loader, "zeGraphDestroyExt") ); + initialzeDdiTable.Graph.pfnPauseCaptureExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGraphPauseCaptureExt") ); + initialzeDdiTable.Graph.pfnResumeCaptureExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGraphResumeCaptureExt") ); + initialzeDdiTable.Graph.pfnGetIdExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zeGraphGetIdExt") ); } return result; diff --git a/source/lib/ze_tracing_register_cb_libapi.cpp b/source/lib/ze_tracing_register_cb_libapi.cpp index 2ad49f94..3ff0f686 100644 --- a/source/lib/ze_tracing_register_cb_libapi.cpp +++ b/source/lib/ze_tracing_register_cb_libapi.cpp @@ -2268,6 +2268,31 @@ zelTracerCommandListAppendSignalEventRegisterCallback( } +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListAppendSignalEventWithParametersRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListAppendSignalEventWithParametersCb_t pfnAppendSignalEventWithParametersCb + ) { + + if(!ze_lib::context->tracing_lib) + return ZE_RESULT_ERROR_UNINITIALIZED; + typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListAppendSignalEventWithParametersCb_t pfnAppendSignalEventWithParametersCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListAppendSignalEventWithParametersRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnAppendSignalEventWithParametersCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerCommandListAppendWaitOnEventsRegisterCallback( zel_tracer_handle_t hTracer, @@ -2293,6 +2318,31 @@ zelTracerCommandListAppendWaitOnEventsRegisterCallback( } +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandListAppendWaitOnEventsWithParametersRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListAppendWaitOnEventsWithParametersCb_t pfnAppendWaitOnEventsWithParametersCb + ) { + + if(!ze_lib::context->tracing_lib) + return ZE_RESULT_ERROR_UNINITIALIZED; + typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandListAppendWaitOnEventsWithParametersCb_t pfnAppendWaitOnEventsWithParametersCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandListAppendWaitOnEventsWithParametersRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnAppendWaitOnEventsWithParametersCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerEventHostSignalRegisterCallback( zel_tracer_handle_t hTracer, @@ -3393,6 +3443,31 @@ zelTracerModuleGetPropertiesRegisterCallback( } +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerModuleGetDeviceHandleRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnModuleGetDeviceHandleCb_t pfnGetDeviceHandleCb + ) { + + if(!ze_lib::context->tracing_lib) + return ZE_RESULT_ERROR_UNINITIALIZED; + typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnModuleGetDeviceHandleCb_t pfnGetDeviceHandleCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerModuleGetDeviceHandleRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnGetDeviceHandleCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerKernelCreateRegisterCallback( zel_tracer_handle_t hTracer, @@ -3718,6 +3793,31 @@ zelTracerKernelGetNameRegisterCallback( } +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerKernelGetModuleHandleRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnKernelGetModuleHandleCb_t pfnGetModuleHandleCb + ) { + + if(!ze_lib::context->tracing_lib) + return ZE_RESULT_ERROR_UNINITIALIZED; + typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnKernelGetModuleHandleCb_t pfnGetModuleHandleCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerKernelGetModuleHandleRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnGetModuleHandleCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerCommandListAppendLaunchKernelRegisterCallback( zel_tracer_handle_t hTracer, @@ -6193,6 +6293,81 @@ zelTracerGraphDestroyExtRegisterCallback( } +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerGraphPauseCaptureExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphPauseCaptureExtCb_t pfnPauseCaptureExtCb + ) { + + if(!ze_lib::context->tracing_lib) + return ZE_RESULT_ERROR_UNINITIALIZED; + typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphPauseCaptureExtCb_t pfnPauseCaptureExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphPauseCaptureExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnPauseCaptureExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerGraphResumeCaptureExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphResumeCaptureExtCb_t pfnResumeCaptureExtCb + ) { + + if(!ze_lib::context->tracing_lib) + return ZE_RESULT_ERROR_UNINITIALIZED; + typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphResumeCaptureExtCb_t pfnResumeCaptureExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphResumeCaptureExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnResumeCaptureExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerGraphGetIdExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphGetIdExtCb_t pfnGetIdExtCb + ) { + + if(!ze_lib::context->tracing_lib) + return ZE_RESULT_ERROR_UNINITIALIZED; + typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnGraphGetIdExtCb_t pfnGetIdExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerGraphGetIdExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnGetIdExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + ZE_APIEXPORT ze_result_t ZE_APICALL zelTracerCommandListAppendHostFunctionRegisterCallback( zel_tracer_handle_t hTracer, @@ -6218,4 +6393,54 @@ zelTracerCommandListAppendHostFunctionRegisterCallback( } +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerCommandQueueSetPriorityExtRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandQueueSetPriorityExtCb_t pfnSetPriorityExtCb + ) { + + if(!ze_lib::context->tracing_lib) + return ZE_RESULT_ERROR_UNINITIALIZED; + typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnCommandQueueSetPriorityExtCb_t pfnSetPriorityExtCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerCommandQueueSetPriorityExtRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnSetPriorityExtCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + +ZE_APIEXPORT ze_result_t ZE_APICALL +zelTracerDeviceGetCompilerInfoRegisterCallback( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDeviceGetCompilerInfoCb_t pfnGetCompilerInfoCb + ) { + + if(!ze_lib::context->tracing_lib) + return ZE_RESULT_ERROR_UNINITIALIZED; + typedef ze_result_t (ZE_APICALL *ze_pfnSetCallback_t)( + zel_tracer_handle_t hTracer, + zel_tracer_reg_t callback_type, + ze_pfnDeviceGetCompilerInfoCb_t pfnGetCompilerInfoCb + ); + + auto func = reinterpret_cast( + GET_FUNCTION_PTR(ze_lib::context->tracing_lib, "zelTracerDeviceGetCompilerInfoRegisterCallback") ); + + if(func) + return func(hTracer, callback_type, pfnGetCompilerInfoCb); + + return ZE_RESULT_ERROR_UNINITIALIZED; +} + + } //Extern C \ No newline at end of file diff --git a/source/lib/zes_libapi.cpp b/source/lib/zes_libapi.cpp index 77f74e76..68e851fe 100644 --- a/source/lib/zes_libapi.cpp +++ b/source/lib/zes_libapi.cpp @@ -48,13 +48,13 @@ extern "C" { /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE /// - ::ZE_RESULT_ERROR_UNKNOWN /// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION -/// + `0x1 < flags` +/// + `0x7 < flags` /// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY ze_result_t ZE_APICALL zesInit( - zes_init_flags_t flags ///< [in] initialization flags. - ///< currently unused, must be 0 (default). + zes_init_flags_t flags ///< [in] initialization flags. This should be 0 or a combination of + ///< ::zes_init_flags_t values. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -7140,6 +7140,10 @@ zesPowerSetEnergyThreshold( /// - The implementation of this function should be lock-free. /// - This function returns the different power usage values associated with /// the power domain. +/// - Computing the average power usage may cause this API to wait and +/// return only after the average power is computed over an interval. +/// Applications that do not need it should pass `nullptr` for +/// `pAveragePower` to reduce the time taken by this function. /// /// @returns /// - ::ZE_RESULT_SUCCESS @@ -7148,9 +7152,7 @@ zesPowerSetEnergyThreshold( /// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY /// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY /// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT -/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE /// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE -/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS /// - ::ZE_RESULT_ERROR_NOT_AVAILABLE /// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET /// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE @@ -7158,13 +7160,18 @@ zesPowerSetEnergyThreshold( /// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE /// + `nullptr == hPower` /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER -/// + `nullptr == pInstantPower` -/// + `nullptr == pAveragePower` +/// + `(nullptr == pInstantPower) && (nullptr == pAveragePower)` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + The requested power usage value is not supported on this power domain. +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// + User does not have permissions to request this feature. ze_result_t ZE_APICALL zesPowerGetUsage( zes_pwr_handle_t hPower, ///< [in] Handle of the power domain. - uint32_t* pInstantPower, ///< [out] Returns the instant power usage in milliwatts. - uint32_t* pAveragePower ///< [out] Returns the average power usage in milliwatts. + uint32_t* pInstantPower, ///< [out][optional] Returns the instant power usage in milliwatts. If this + ///< is `nullptr`, the instant power usage will not be returned. + uint32_t* pAveragePower ///< [out][optional] Returns the average power usage in milliwatts. If this + ///< is `nullptr`, the average power usage will not be returned. ) { #ifdef L0_STATIC_LOADER_BUILD @@ -10964,4 +10971,143 @@ zesDevicePciLinkSpeedUpdateExt( #endif } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Get device health status +/// +/// @details +/// - This function retrieves the current health status of the device. +/// - The health status is stored in non-volatile memory and persists across +/// resets and updates. +/// - The health indicator serves purely as telemetry without downstream +/// functional effects. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER +/// + `nullptr == pHealth` +ze_result_t ZE_APICALL +zesDeviceGetHealthStatusExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_health_status_ext_t* pHealth ///< [out] Current health status of the device. + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const zes_pfnDeviceGetHealthStatusExt_t pfnGetHealthStatusExt = [&result] { + auto pfnGetHealthStatusExt = ze_lib::context->zesDdiTable.load()->Device.pfnGetHealthStatusExt; + if( nullptr == pfnGetHealthStatusExt ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnGetHealthStatusExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnGetHealthStatusExt( hDevice, pHealth ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnGetHealthStatusExt = ze_lib::context->zesDdiTable.load()->Device.pfnGetHealthStatusExt; + if( nullptr == pfnGetHealthStatusExt ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnGetHealthStatusExt( hDevice, pHealth ); + #endif +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Set device health status +/// +/// @details +/// - This function sets the health status of the device. +/// - The health status is persisted to non-volatile memory. +/// - Setting health status requires appropriate permissions. +/// - The application should not call this function from simultaneous +/// threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::ZE_RESULT_SUCCESS +/// - ::ZE_RESULT_ERROR_UNINITIALIZED +/// - ::ZE_RESULT_ERROR_DEVICE_LOST +/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY +/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY +/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE +/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE +/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE +/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET +/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE +/// - ::ZE_RESULT_ERROR_UNKNOWN +/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `nullptr == hDevice` +/// - ::ZE_RESULT_ERROR_INVALID_ENUMERATION +/// + `::ZES_DEVICE_HEALTH_STATUS_EXT_FAILED < health` +/// - ::ZE_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS +/// + User does not have permissions to set health status. +ze_result_t ZE_APICALL +zesDeviceSetHealthStatusExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_health_status_ext_t health ///< [in] New health status to be set for the device. + ) +{ + #ifdef L0_STATIC_LOADER_BUILD + ze_result_t result = ZE_RESULT_SUCCESS; + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + static const zes_pfnDeviceSetHealthStatusExt_t pfnSetHealthStatusExt = [&result] { + auto pfnSetHealthStatusExt = ze_lib::context->zesDdiTable.load()->Device.pfnSetHealthStatusExt; + if( nullptr == pfnSetHealthStatusExt ) { + result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + return pfnSetHealthStatusExt; + }(); + if (result != ZE_RESULT_SUCCESS) { + return result; + } + return pfnSetHealthStatusExt( hDevice, health ); + #else + if(ze_lib::destruction) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + + auto pfnSetHealthStatusExt = ze_lib::context->zesDdiTable.load()->Device.pfnSetHealthStatusExt; + if( nullptr == pfnSetHealthStatusExt ) { + if(!ze_lib::context->isInitialized) + return ZE_RESULT_ERROR_UNINITIALIZED; + else + return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + return pfnSetHealthStatusExt( hDevice, health ); + #endif +} + } // extern "C" diff --git a/source/lib/zes_libddi.cpp b/source/lib/zes_libddi.cpp index b6cf2135..d1c3e2dc 100644 --- a/source/lib/zes_libddi.cpp +++ b/source/lib/zes_libddi.cpp @@ -88,6 +88,10 @@ namespace ze_lib GET_FUNCTION_PTR(loader, "zesDeviceEnumTemperatureSensors") ); initialzesDdiTable.Device.pfnPciLinkSpeedUpdateExt = reinterpret_cast( GET_FUNCTION_PTR(loader, "zesDevicePciLinkSpeedUpdateExt") ); + initialzesDdiTable.Device.pfnGetHealthStatusExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zesDeviceGetHealthStatusExt") ); + initialzesDdiTable.Device.pfnSetHealthStatusExt = reinterpret_cast( + GET_FUNCTION_PTR(loader, "zesDeviceSetHealthStatusExt") ); initialzesDdiTable.Device.pfnEccAvailable = reinterpret_cast( GET_FUNCTION_PTR(loader, "zesDeviceEccAvailable") ); initialzesDdiTable.Device.pfnEccConfigurable = reinterpret_cast( diff --git a/source/loader/ze_ldrddi.cpp b/source/loader/ze_ldrddi.cpp index 1e396cb4..64ae4a68 100644 --- a/source/loader/ze_ldrddi.cpp +++ b/source/loader/ze_ldrddi.cpp @@ -3339,6 +3339,35 @@ namespace loader return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendSignalEventWithParameters + __zedlllocal ze_result_t ZE_APICALL + zeCommandListAppendSignalEventWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + ze_event_handle_t hEvent ///< [in] handle of the event + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnAppendSignalEventWithParameters = dditable->ze.CommandList.pfnAppendSignalEventWithParameters; + if( nullptr == pfnAppendSignalEventWithParameters ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hCommandList = reinterpret_cast( hCommandList )->handle; + + // convert loader handle to driver handle + hEvent = reinterpret_cast( hEvent )->handle; + + // forward to device-driver + result = pfnAppendSignalEventWithParameters( hCommandList, pNext, hEvent ); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListAppendWaitOnEvents __zedlllocal ze_result_t ZE_APICALL @@ -3372,6 +3401,40 @@ namespace loader return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendWaitOnEventsWithParameters + __zedlllocal ze_result_t ZE_APICALL + zeCommandListAppendWaitOnEventsWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + uint32_t numEvents, ///< [in] number of events to wait on before continuing + ze_event_handle_t* phEvents ///< [in][range(0, numEvents)] handles of the events to wait on before + ///< continuing + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hCommandList )->dditable; + auto pfnAppendWaitOnEventsWithParameters = dditable->ze.CommandList.pfnAppendWaitOnEventsWithParameters; + if( nullptr == pfnAppendWaitOnEventsWithParameters ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hCommandList = reinterpret_cast( hCommandList )->handle; + + // convert loader handles to driver handles, preserving a null input array + auto phEventsLocal = ( phEvents ) ? new ze_event_handle_t [numEvents] : nullptr; + for( size_t i = 0; ( nullptr != phEvents ) && ( i < numEvents ); ++i ) + phEventsLocal[ i ] = reinterpret_cast( phEvents[ i ] )->handle; + + // forward to device-driver + result = pfnAppendWaitOnEventsWithParameters( hCommandList, pNext, numEvents, phEventsLocal ); + delete []phEventsLocal; + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeEventHostSignal __zedlllocal ze_result_t ZE_APICALL @@ -4737,6 +4800,45 @@ namespace loader return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeModuleGetDeviceHandle + __zedlllocal ze_result_t ZE_APICALL + zeModuleGetDeviceHandle( + ze_module_handle_t hModule, ///< [in] handle of the module + ze_device_handle_t* phDevice ///< [out] handle of the device the module was created for + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hModule )->dditable; + auto pfnGetDeviceHandle = dditable->ze.Module.pfnGetDeviceHandle; + if( nullptr == pfnGetDeviceHandle ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hModule = reinterpret_cast( hModule )->handle; + + // forward to device-driver + result = pfnGetDeviceHandle( hModule, phDevice ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phDevice = reinterpret_cast( + context->ze_device_factory.getInstance( *phDevice, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeKernelCreate __zedlllocal ze_result_t ZE_APICALL @@ -5124,6 +5226,45 @@ namespace loader return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeKernelGetModuleHandle + __zedlllocal ze_result_t ZE_APICALL + zeKernelGetModuleHandle( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel + ze_module_handle_t* phModule ///< [out] handle of the module the kernel was created from + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hKernel )->dditable; + auto pfnGetModuleHandle = dditable->ze.Kernel.pfnGetModuleHandle; + if( nullptr == pfnGetModuleHandle ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hKernel = reinterpret_cast( hKernel )->handle; + + // forward to device-driver + result = pfnGetModuleHandle( hKernel, phModule ); + + if( ZE_RESULT_SUCCESS != result ) + return result; + + try + { + // convert driver handle to loader handle + *phModule = reinterpret_cast( + context->ze_module_factory.getInstance( *phModule, dditable ) ); + } + catch( std::bad_alloc& ) + { + result = ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListAppendLaunchKernel __zedlllocal ze_result_t ZE_APICALL @@ -8573,6 +8714,79 @@ namespace loader return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphPauseCaptureExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphPauseCaptureExt( + ze_graph_handle_t hGraph ///< [in] handle to the graph to pause capture + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hGraph )->dditable; + auto pfnPauseCaptureExt = dditable->ze.Graph.pfnPauseCaptureExt; + if( nullptr == pfnPauseCaptureExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hGraph = reinterpret_cast( hGraph )->handle; + + // forward to device-driver + result = pfnPauseCaptureExt( hGraph ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphResumeCaptureExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphResumeCaptureExt( + ze_graph_handle_t hGraph ///< [in] handle to the graph to resume capture + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hGraph )->dditable; + auto pfnResumeCaptureExt = dditable->ze.Graph.pfnResumeCaptureExt; + if( nullptr == pfnResumeCaptureExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hGraph = reinterpret_cast( hGraph )->handle; + + // forward to device-driver + result = pfnResumeCaptureExt( hGraph ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphGetIdExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphGetIdExt( + ze_graph_handle_t hGraph, ///< [in] handle to the graph + uint64_t* pGraphId ///< [out] pointer to the memory where the graph ID will be written + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hGraph )->dditable; + auto pfnGetIdExt = dditable->ze.Graph.pfnGetIdExt; + if( nullptr == pfnGetIdExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hGraph = reinterpret_cast( hGraph )->handle; + + // forward to device-driver + result = pfnGetIdExt( hGraph, pGraphId ); + + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListAppendHostFunction __zedlllocal ze_result_t ZE_APICALL @@ -8616,6 +8830,64 @@ namespace loader return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueSetPriorityExt + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueSetPriorityExt( + ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t priority ///< [in] priority to set for the command queue + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hCommandQueue )->dditable; + auto pfnSetPriorityExt = dditable->ze.CommandQueue.pfnSetPriorityExt; + if( nullptr == pfnSetPriorityExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hCommandQueue = reinterpret_cast( hCommandQueue )->handle; + + // forward to device-driver + result = pfnSetPriorityExt( hCommandQueue, priority ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetCompilerInfo + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetCompilerInfo( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_device_compiler_info_t paramName, ///< [in] compiler-info to return + const void* pNext, ///< [in][optional] additional extensions passed to the function + size_t* pSize, ///< [in,out] pointer to the size in bytes of the result. + ///< If size is zero, then the driver shall update the value with the total + ///< size in bytes needed. + ///< If size is less than the total size needed, then the driver shall + ///< update the value with the required size and shall not write to pData. + void* pData ///< [in,out][optional][range(0, *pSize)] pointer to the result buffer. + ///< If pData is nullptr, then only the required size is returned in pSize. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hDevice )->dditable; + auto pfnGetCompilerInfo = dditable->ze.Device.pfnGetCompilerInfo; + if( nullptr == pfnGetCompilerInfo ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hDevice = reinterpret_cast( hDevice )->handle; + + // forward to device-driver + result = pfnGetCompilerInfo( hDevice, paramName, pNext, pSize, pData ); + + return result; + } + } // namespace loader #if defined(__cplusplus) @@ -8737,6 +9009,7 @@ zeGetDeviceProcAddrTableLegacy() loader::loaderDispatch->pCore->Device->pfnGetRuntimeRequirementsKey = loader::zeDeviceGetRuntimeRequirementsKey; loader::loaderDispatch->pCore->Device->pfnValidateRuntimeRequirements = loader::zeDeviceValidateRuntimeRequirements; loader::loaderDispatch->pCore->Device->pfnGetCounterBasedEventMaxValue = loader::zeDeviceGetCounterBasedEventMaxValue; + loader::loaderDispatch->pCore->Device->pfnGetCompilerInfo = loader::zeDeviceGetCompilerInfo; loader::loaderDispatch->pCore->Device->pfnReserveCacheExt = loader::zeDeviceReserveCacheExt; loader::loaderDispatch->pCore->Device->pfnSetCacheAdviceExt = loader::zeDeviceSetCacheAdviceExt; loader::loaderDispatch->pCore->Device->pfnPciGetPropertiesExt = loader::zeDevicePciGetPropertiesExt; @@ -8782,6 +9055,7 @@ zeGetCommandQueueProcAddrTableLegacy() loader::loaderDispatch->pCore->CommandQueue->pfnGetFlags = loader::zeCommandQueueGetFlags; loader::loaderDispatch->pCore->CommandQueue->pfnGetMode = loader::zeCommandQueueGetMode; loader::loaderDispatch->pCore->CommandQueue->pfnGetPriority = loader::zeCommandQueueGetPriority; + loader::loaderDispatch->pCore->CommandQueue->pfnSetPriorityExt = loader::zeCommandQueueSetPriorityExt; loader::loaderDispatch->pCore->CommandQueue->pfnGetOrdinal = loader::zeCommandQueueGetOrdinal; loader::loaderDispatch->pCore->CommandQueue->pfnGetIndex = loader::zeCommandQueueGetIndex; } @@ -8836,6 +9110,8 @@ zeGetCommandListProcAddrTableLegacy() loader::loaderDispatch->pCore->CommandList->pfnGetGraphExt = loader::zeCommandListGetGraphExt; loader::loaderDispatch->pCore->CommandList->pfnAppendGraphExt = loader::zeCommandListAppendGraphExt; loader::loaderDispatch->pCore->CommandList->pfnAppendHostFunction = loader::zeCommandListAppendHostFunction; + loader::loaderDispatch->pCore->CommandList->pfnAppendSignalEventWithParameters = loader::zeCommandListAppendSignalEventWithParameters; + loader::loaderDispatch->pCore->CommandList->pfnAppendWaitOnEventsWithParameters = loader::zeCommandListAppendWaitOnEventsWithParameters; loader::loaderDispatch->pCore->CommandList->pfnAppendImageCopyToMemoryExt = loader::zeCommandListAppendImageCopyToMemoryExt; loader::loaderDispatch->pCore->CommandList->pfnAppendImageCopyFromMemoryExt = loader::zeCommandListAppendImageCopyFromMemoryExt; loader::loaderDispatch->pCore->CommandList->pfnHostSynchronize = loader::zeCommandListHostSynchronize; @@ -8968,6 +9244,7 @@ zeGetKernelProcAddrTableLegacy() loader::loaderDispatch->pCore->Kernel->pfnGetSourceAttributes = loader::zeKernelGetSourceAttributes; loader::loaderDispatch->pCore->Kernel->pfnGetProperties = loader::zeKernelGetProperties; loader::loaderDispatch->pCore->Kernel->pfnGetName = loader::zeKernelGetName; + loader::loaderDispatch->pCore->Kernel->pfnGetModuleHandle = loader::zeKernelGetModuleHandle; } /////////////////////////////////////////////////////////////////////////////// @@ -9029,6 +9306,7 @@ zeGetModuleProcAddrTableLegacy() loader::loaderDispatch->pCore->Module->pfnGetKernelNames = loader::zeModuleGetKernelNames; loader::loaderDispatch->pCore->Module->pfnGetProperties = loader::zeModuleGetProperties; loader::loaderDispatch->pCore->Module->pfnGetFunctionPointer = loader::zeModuleGetFunctionPointer; + loader::loaderDispatch->pCore->Module->pfnGetDeviceHandle = loader::zeModuleGetDeviceHandle; loader::loaderDispatch->pCore->Module->pfnInspectLinkageExt = loader::zeModuleInspectLinkageExt; } @@ -9124,6 +9402,9 @@ zeGetGraphProcAddrTableLegacy() loader::loaderDispatch->pCore->Graph->pfnIsEmptyExt = loader::zeGraphIsEmptyExt; loader::loaderDispatch->pCore->Graph->pfnDumpContentsExt = loader::zeGraphDumpContentsExt; loader::loaderDispatch->pCore->Graph->pfnDestroyExt = loader::zeGraphDestroyExt; + loader::loaderDispatch->pCore->Graph->pfnPauseCaptureExt = loader::zeGraphPauseCaptureExt; + loader::loaderDispatch->pCore->Graph->pfnResumeCaptureExt = loader::zeGraphResumeCaptureExt; + loader::loaderDispatch->pCore->Graph->pfnGetIdExt = loader::zeGraphGetIdExt; } @@ -10935,6 +11216,13 @@ zeGetDeviceProcAddrTable( pDdiTable->pfnGetCounterBasedEventMaxValue = loader::zeDeviceGetCounterBasedEventMaxValue; } } + if (version >= ZE_API_VERSION_1_18) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetCompilerInfo = loader_driver_ddi::zeDeviceGetCompilerInfo; + } else { + pDdiTable->pfnGetCompilerInfo = loader::zeDeviceGetCompilerInfo; + } + } if (version >= ZE_API_VERSION_1_2) { if (loader::context->driverDDIPathDefault) { pDdiTable->pfnReserveCacheExt = loader_driver_ddi::zeDeviceReserveCacheExt; @@ -11040,6 +11328,9 @@ zeGetDeviceProcAddrTable( if (version >= ZE_API_VERSION_1_17) { pDdiTable->pfnGetCounterBasedEventMaxValue = firstDriver->dditable.ze.Device.pfnGetCounterBasedEventMaxValue; } + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnGetCompilerInfo = firstDriver->dditable.ze.Device.pfnGetCompilerInfo; + } if (version >= ZE_API_VERSION_1_2) { pDdiTable->pfnReserveCacheExt = firstDriver->dditable.ze.Device.pfnReserveCacheExt; } @@ -11430,6 +11721,13 @@ zeGetCommandQueueProcAddrTable( pDdiTable->pfnGetPriority = loader::zeCommandQueueGetPriority; } } + if (version >= ZE_API_VERSION_1_18) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetPriorityExt = loader_driver_ddi::zeCommandQueueSetPriorityExt; + } else { + pDdiTable->pfnSetPriorityExt = loader::zeCommandQueueSetPriorityExt; + } + } if (version >= ZE_API_VERSION_1_9) { if (loader::context->driverDDIPathDefault) { pDdiTable->pfnGetOrdinal = loader_driver_ddi::zeCommandQueueGetOrdinal; @@ -11470,6 +11768,9 @@ zeGetCommandQueueProcAddrTable( if (version >= ZE_API_VERSION_1_17) { pDdiTable->pfnGetPriority = firstDriver->dditable.ze.CommandQueue.pfnGetPriority; } + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnSetPriorityExt = firstDriver->dditable.ze.CommandQueue.pfnSetPriorityExt; + } if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetOrdinal = firstDriver->dditable.ze.CommandQueue.pfnGetOrdinal; } @@ -11857,6 +12158,20 @@ zeGetCommandListProcAddrTable( pDdiTable->pfnAppendHostFunction = loader::zeCommandListAppendHostFunction; } } + if (version >= ZE_API_VERSION_1_18) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendSignalEventWithParameters = loader_driver_ddi::zeCommandListAppendSignalEventWithParameters; + } else { + pDdiTable->pfnAppendSignalEventWithParameters = loader::zeCommandListAppendSignalEventWithParameters; + } + } + if (version >= ZE_API_VERSION_1_18) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnAppendWaitOnEventsWithParameters = loader_driver_ddi::zeCommandListAppendWaitOnEventsWithParameters; + } else { + pDdiTable->pfnAppendWaitOnEventsWithParameters = loader::zeCommandListAppendWaitOnEventsWithParameters; + } + } if (version >= ZE_API_VERSION_1_3) { if (loader::context->driverDDIPathDefault) { pDdiTable->pfnAppendImageCopyToMemoryExt = loader_driver_ddi::zeCommandListAppendImageCopyToMemoryExt; @@ -12050,6 +12365,12 @@ zeGetCommandListProcAddrTable( if (version >= ZE_API_VERSION_1_17) { pDdiTable->pfnAppendHostFunction = firstDriver->dditable.ze.CommandList.pfnAppendHostFunction; } + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnAppendSignalEventWithParameters = firstDriver->dditable.ze.CommandList.pfnAppendSignalEventWithParameters; + } + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnAppendWaitOnEventsWithParameters = firstDriver->dditable.ze.CommandList.pfnAppendWaitOnEventsWithParameters; + } if (version >= ZE_API_VERSION_1_3) { pDdiTable->pfnAppendImageCopyToMemoryExt = firstDriver->dditable.ze.CommandList.pfnAppendImageCopyToMemoryExt; } @@ -13257,6 +13578,13 @@ zeGetKernelProcAddrTable( pDdiTable->pfnGetName = loader::zeKernelGetName; } } + if (version >= ZE_API_VERSION_1_18) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetModuleHandle = loader_driver_ddi::zeKernelGetModuleHandle; + } else { + pDdiTable->pfnGetModuleHandle = loader::zeKernelGetModuleHandle; + } + } zeGetKernelProcAddrTableLegacy(); } else @@ -13298,6 +13626,9 @@ zeGetKernelProcAddrTable( if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetName = firstDriver->dditable.ze.Kernel.pfnGetName; } + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnGetModuleHandle = firstDriver->dditable.ze.Kernel.pfnGetModuleHandle; + } } } @@ -13871,6 +14202,13 @@ zeGetModuleProcAddrTable( pDdiTable->pfnGetFunctionPointer = loader::zeModuleGetFunctionPointer; } } + if (version >= ZE_API_VERSION_1_18) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetDeviceHandle = loader_driver_ddi::zeModuleGetDeviceHandle; + } else { + pDdiTable->pfnGetDeviceHandle = loader::zeModuleGetDeviceHandle; + } + } if (version >= ZE_API_VERSION_1_3) { if (loader::context->driverDDIPathDefault) { pDdiTable->pfnInspectLinkageExt = loader_driver_ddi::zeModuleInspectLinkageExt; @@ -13907,6 +14245,9 @@ zeGetModuleProcAddrTable( if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetFunctionPointer = firstDriver->dditable.ze.Module.pfnGetFunctionPointer; } + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnGetDeviceHandle = firstDriver->dditable.ze.Module.pfnGetDeviceHandle; + } if (version >= ZE_API_VERSION_1_3) { pDdiTable->pfnInspectLinkageExt = firstDriver->dditable.ze.Module.pfnInspectLinkageExt; } @@ -14808,6 +15149,27 @@ zeGetGraphProcAddrTable( pDdiTable->pfnDestroyExt = loader::zeGraphDestroyExt; } } + if (version >= ZE_API_VERSION_1_18) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnPauseCaptureExt = loader_driver_ddi::zeGraphPauseCaptureExt; + } else { + pDdiTable->pfnPauseCaptureExt = loader::zeGraphPauseCaptureExt; + } + } + if (version >= ZE_API_VERSION_1_18) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnResumeCaptureExt = loader_driver_ddi::zeGraphResumeCaptureExt; + } else { + pDdiTable->pfnResumeCaptureExt = loader::zeGraphResumeCaptureExt; + } + } + if (version >= ZE_API_VERSION_1_18) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetIdExt = loader_driver_ddi::zeGraphGetIdExt; + } else { + pDdiTable->pfnGetIdExt = loader::zeGraphGetIdExt; + } + } zeGetGraphProcAddrTableLegacy(); } else @@ -14834,6 +15196,15 @@ zeGetGraphProcAddrTable( if (version >= ZE_API_VERSION_1_17) { pDdiTable->pfnDestroyExt = firstDriver->dditable.ze.Graph.pfnDestroyExt; } + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnPauseCaptureExt = firstDriver->dditable.ze.Graph.pfnPauseCaptureExt; + } + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnResumeCaptureExt = firstDriver->dditable.ze.Graph.pfnResumeCaptureExt; + } + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnGetIdExt = firstDriver->dditable.ze.Graph.pfnGetIdExt; + } } } diff --git a/source/loader/ze_ldrddi.h b/source/loader/ze_ldrddi.h index 4fa56034..3bdef02e 100644 --- a/source/loader/ze_ldrddi.h +++ b/source/loader/ze_ldrddi.h @@ -746,6 +746,12 @@ namespace loader_driver_ddi ze_event_handle_t hEvent ///< [in] handle of the event ); __zedlllocal ze_result_t ZE_APICALL + zeCommandListAppendSignalEventWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + ze_event_handle_t hEvent ///< [in] handle of the event + ); + __zedlllocal ze_result_t ZE_APICALL zeCommandListAppendWaitOnEvents( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list uint32_t numEvents, ///< [in] number of events to wait on before continuing @@ -753,6 +759,14 @@ namespace loader_driver_ddi ///< continuing ); __zedlllocal ze_result_t ZE_APICALL + zeCommandListAppendWaitOnEventsWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + uint32_t numEvents, ///< [in] number of events to wait on before continuing + ze_event_handle_t* phEvents ///< [in][range(0, numEvents)] handles of the events to wait on before + ///< continuing + ); + __zedlllocal ze_result_t ZE_APICALL zeEventHostSignal( ze_event_handle_t hEvent ///< [in] handle of the event ); @@ -1049,6 +1063,11 @@ namespace loader_driver_ddi ze_module_properties_t* pModuleProperties ///< [in,out] query result for module properties. ); __zedlllocal ze_result_t ZE_APICALL + zeModuleGetDeviceHandle( + ze_module_handle_t hModule, ///< [in] handle of the module + ze_device_handle_t* phDevice ///< [out] handle of the device the module was created for + ); + __zedlllocal ze_result_t ZE_APICALL zeKernelCreate( ze_module_handle_t hModule, ///< [in] handle of the module const ze_kernel_desc_t* desc, ///< [in] pointer to kernel descriptor @@ -1140,6 +1159,11 @@ namespace loader_driver_ddi char* pName ///< [in,out][optional] char pointer to kernel name. ); __zedlllocal ze_result_t ZE_APICALL + zeKernelGetModuleHandle( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel + ze_module_handle_t* phModule ///< [out] handle of the module the kernel was created from + ); + __zedlllocal ze_result_t ZE_APICALL zeCommandListAppendLaunchKernel( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list ze_kernel_handle_t hKernel, ///< [in] handle of the kernel object @@ -1932,6 +1956,19 @@ namespace loader_driver_ddi ze_graph_handle_t hGraph ///< [in][release] handle of the graph to destroy ); __zedlllocal ze_result_t ZE_APICALL + zeGraphPauseCaptureExt( + ze_graph_handle_t hGraph ///< [in] handle to the graph to pause capture + ); + __zedlllocal ze_result_t ZE_APICALL + zeGraphResumeCaptureExt( + ze_graph_handle_t hGraph ///< [in] handle to the graph to resume capture + ); + __zedlllocal ze_result_t ZE_APICALL + zeGraphGetIdExt( + ze_graph_handle_t hGraph, ///< [in] handle to the graph + uint64_t* pGraphId ///< [out] pointer to the memory where the graph ID will be written + ); + __zedlllocal ze_result_t ZE_APICALL zeCommandListAppendHostFunction( ze_command_list_handle_t hCommandList, ///< [in] handle of the command list ze_host_function_callback_t pfnHostFunction, ///< [in] host function to call, expected to be lightweight and @@ -1945,6 +1982,24 @@ namespace loader_driver_ddi ze_event_handle_t* phWaitEvents ///< [in][optional][range(0, numWaitEvents)] handle of the events to wait ///< on before launching ); + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueSetPriorityExt( + ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t priority ///< [in] priority to set for the command queue + ); + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetCompilerInfo( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_device_compiler_info_t paramName, ///< [in] compiler-info to return + const void* pNext, ///< [in][optional] additional extensions passed to the function + size_t* pSize, ///< [in,out] pointer to the size in bytes of the result. + ///< If size is zero, then the driver shall update the value with the total + ///< size in bytes needed. + ///< If size is less than the total size needed, then the driver shall + ///< update the value with the required size and shall not write to pData. + void* pData ///< [in,out][optional][range(0, *pSize)] pointer to the result buffer. + ///< If pData is nullptr, then only the required size is returned in pSize. + ); } #if defined(__cplusplus) diff --git a/source/loader/ze_ldrddi_driver_ddi.cpp b/source/loader/ze_ldrddi_driver_ddi.cpp index 0003734a..27b28e1e 100644 --- a/source/loader/ze_ldrddi_driver_ddi.cpp +++ b/source/loader/ze_ldrddi_driver_ddi.cpp @@ -2925,6 +2925,38 @@ namespace loader_driver_ddi return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendSignalEventWithParameters + __zedlllocal ze_result_t ZE_APICALL + zeCommandListAppendSignalEventWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + ze_event_handle_t hEvent ///< [in] handle of the event + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hCommandList )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->CommandList == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + auto pfnAppendSignalEventWithParameters = dditable->CommandList->pfnAppendSignalEventWithParameters; + if( nullptr == pfnAppendSignalEventWithParameters ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnAppendSignalEventWithParameters( hCommandList, pNext, hEvent ); + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListAppendWaitOnEvents __zedlllocal ze_result_t ZE_APICALL @@ -2958,6 +2990,40 @@ namespace loader_driver_ddi return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandListAppendWaitOnEventsWithParameters + __zedlllocal ze_result_t ZE_APICALL + zeCommandListAppendWaitOnEventsWithParameters( + ze_command_list_handle_t hCommandList, ///< [in] handle of the command list + const void * pNext, ///< [in][optional] additional parameters passed to the function + uint32_t numEvents, ///< [in] number of events to wait on before continuing + ze_event_handle_t* phEvents ///< [in][range(0, numEvents)] handles of the events to wait on before + ///< continuing + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hCommandList )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->CommandList == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + auto pfnAppendWaitOnEventsWithParameters = dditable->CommandList->pfnAppendWaitOnEventsWithParameters; + if( nullptr == pfnAppendWaitOnEventsWithParameters ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnAppendWaitOnEventsWithParameters( hCommandList, pNext, numEvents, phEvents ); + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeEventHostSignal __zedlllocal ze_result_t ZE_APICALL @@ -4398,6 +4464,37 @@ namespace loader_driver_ddi return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeModuleGetDeviceHandle + __zedlllocal ze_result_t ZE_APICALL + zeModuleGetDeviceHandle( + ze_module_handle_t hModule, ///< [in] handle of the module + ze_device_handle_t* phDevice ///< [out] handle of the device the module was created for + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hModule )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->Module == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + auto pfnGetDeviceHandle = dditable->Module->pfnGetDeviceHandle; + if( nullptr == pfnGetDeviceHandle ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnGetDeviceHandle( hModule, phDevice ); + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeKernelCreate __zedlllocal ze_result_t ZE_APICALL @@ -4827,6 +4924,37 @@ namespace loader_driver_ddi return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeKernelGetModuleHandle + __zedlllocal ze_result_t ZE_APICALL + zeKernelGetModuleHandle( + ze_kernel_handle_t hKernel, ///< [in] handle of the kernel + ze_module_handle_t* phModule ///< [out] handle of the module the kernel was created from + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hKernel )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->Kernel == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + auto pfnGetModuleHandle = dditable->Kernel->pfnGetModuleHandle; + if( nullptr == pfnGetModuleHandle ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnGetModuleHandle( hKernel, phModule ); + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListAppendLaunchKernel __zedlllocal ze_result_t ZE_APICALL @@ -8193,6 +8321,97 @@ namespace loader_driver_ddi return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphPauseCaptureExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphPauseCaptureExt( + ze_graph_handle_t hGraph ///< [in] handle to the graph to pause capture + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hGraph )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->Graph == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + auto pfnPauseCaptureExt = dditable->Graph->pfnPauseCaptureExt; + if( nullptr == pfnPauseCaptureExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnPauseCaptureExt( hGraph ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphResumeCaptureExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphResumeCaptureExt( + ze_graph_handle_t hGraph ///< [in] handle to the graph to resume capture + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hGraph )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->Graph == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + auto pfnResumeCaptureExt = dditable->Graph->pfnResumeCaptureExt; + if( nullptr == pfnResumeCaptureExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnResumeCaptureExt( hGraph ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeGraphGetIdExt + __zedlllocal ze_result_t ZE_APICALL + zeGraphGetIdExt( + ze_graph_handle_t hGraph, ///< [in] handle to the graph + uint64_t* pGraphId ///< [out] pointer to the memory where the graph ID will be written + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hGraph )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->Graph == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + auto pfnGetIdExt = dditable->Graph->pfnGetIdExt; + if( nullptr == pfnGetIdExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnGetIdExt( hGraph, pGraphId ); + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for zeCommandListAppendHostFunction __zedlllocal ze_result_t ZE_APICALL @@ -8233,6 +8452,76 @@ namespace loader_driver_ddi return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeCommandQueueSetPriorityExt + __zedlllocal ze_result_t ZE_APICALL + zeCommandQueueSetPriorityExt( + ze_command_queue_handle_t hCommandQueue, ///< [in] handle of the command queue + ze_command_queue_priority_t priority ///< [in] priority to set for the command queue + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hCommandQueue )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->CommandQueue == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + auto pfnSetPriorityExt = dditable->CommandQueue->pfnSetPriorityExt; + if( nullptr == pfnSetPriorityExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnSetPriorityExt( hCommandQueue, priority ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zeDeviceGetCompilerInfo + __zedlllocal ze_result_t ZE_APICALL + zeDeviceGetCompilerInfo( + ze_device_handle_t hDevice, ///< [in] handle of the device + ze_device_compiler_info_t paramName, ///< [in] compiler-info to return + const void* pNext, ///< [in][optional] additional extensions passed to the function + size_t* pSize, ///< [in,out] pointer to the size in bytes of the result. + ///< If size is zero, then the driver shall update the value with the total + ///< size in bytes needed. + ///< If size is less than the total size needed, then the driver shall + ///< update the value with the required size and shall not write to pData. + void* pData ///< [in,out][optional][range(0, *pSize)] pointer to the result buffer. + ///< If pData is nullptr, then only the required size is returned in pSize. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDevice )->pCore; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->Device == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + auto pfnGetCompilerInfo = dditable->Device->pfnGetCompilerInfo; + if( nullptr == pfnGetCompilerInfo ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnGetCompilerInfo( hDevice, paramName, pNext, pSize, pData ); + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief function for removing the ddi driver tables for ze diff --git a/source/loader/zes_ldrddi.cpp b/source/loader/zes_ldrddi.cpp index 1217a8de..b4aa8841 100644 --- a/source/loader/zes_ldrddi.cpp +++ b/source/loader/zes_ldrddi.cpp @@ -133,8 +133,8 @@ namespace loader /// @brief Intercept function for zesInit __zedlllocal ze_result_t ZE_APICALL zesInit( - zes_init_flags_t flags ///< [in] initialization flags. - ///< currently unused, must be 0 (default). + zes_init_flags_t flags ///< [in] initialization flags. This should be 0 or a combination of + ///< ::zes_init_flags_t values. ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -3265,8 +3265,10 @@ namespace loader __zedlllocal ze_result_t ZE_APICALL zesPowerGetUsage( zes_pwr_handle_t hPower, ///< [in] Handle of the power domain. - uint32_t* pInstantPower, ///< [out] Returns the instant power usage in milliwatts. - uint32_t* pAveragePower ///< [out] Returns the average power usage in milliwatts. + uint32_t* pInstantPower, ///< [out][optional] Returns the instant power usage in milliwatts. If this + ///< is `nullptr`, the instant power usage will not be returned. + uint32_t* pAveragePower ///< [out][optional] Returns the average power usage in milliwatts. If this + ///< is `nullptr`, the average power usage will not be returned. ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -4919,6 +4921,56 @@ namespace loader return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceGetHealthStatusExt + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGetHealthStatusExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_health_status_ext_t* pHealth ///< [out] Current health status of the device. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hDevice )->dditable; + auto pfnGetHealthStatusExt = dditable->zes.Device.pfnGetHealthStatusExt; + if( nullptr == pfnGetHealthStatusExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hDevice = reinterpret_cast( hDevice )->handle; + + // forward to device-driver + result = pfnGetHealthStatusExt( hDevice, pHealth ); + + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceSetHealthStatusExt + __zedlllocal ze_result_t ZE_APICALL + zesDeviceSetHealthStatusExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_health_status_ext_t health ///< [in] New health status to be set for the device. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract driver's function pointer table + auto dditable = reinterpret_cast( hDevice )->dditable; + auto pfnSetHealthStatusExt = dditable->zes.Device.pfnSetHealthStatusExt; + if( nullptr == pfnSetHealthStatusExt ) + return ZE_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to driver handle + hDevice = reinterpret_cast( hDevice )->handle; + + // forward to device-driver + result = pfnSetHealthStatusExt( hDevice, health ); + + return result; + } + } // namespace loader #if defined(__cplusplus) @@ -4966,6 +5018,8 @@ zesGetDeviceProcAddrTableLegacy() loader::loaderDispatch->pSysman->Device->pfnEnumStandbyDomains = loader::zesDeviceEnumStandbyDomains; loader::loaderDispatch->pSysman->Device->pfnEnumTemperatureSensors = loader::zesDeviceEnumTemperatureSensors; loader::loaderDispatch->pSysman->Device->pfnPciLinkSpeedUpdateExt = loader::zesDevicePciLinkSpeedUpdateExt; + loader::loaderDispatch->pSysman->Device->pfnGetHealthStatusExt = loader::zesDeviceGetHealthStatusExt; + loader::loaderDispatch->pSysman->Device->pfnSetHealthStatusExt = loader::zesDeviceSetHealthStatusExt; loader::loaderDispatch->pSysman->Device->pfnEccAvailable = loader::zesDeviceEccAvailable; loader::loaderDispatch->pSysman->Device->pfnEccConfigurable = loader::zesDeviceEccConfigurable; loader::loaderDispatch->pSysman->Device->pfnGetEccState = loader::zesDeviceGetEccState; @@ -6168,6 +6222,20 @@ zesGetDeviceProcAddrTable( pDdiTable->pfnPciLinkSpeedUpdateExt = loader::zesDevicePciLinkSpeedUpdateExt; } } + if (version >= ZE_API_VERSION_1_18) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnGetHealthStatusExt = loader_driver_ddi::zesDeviceGetHealthStatusExt; + } else { + pDdiTable->pfnGetHealthStatusExt = loader::zesDeviceGetHealthStatusExt; + } + } + if (version >= ZE_API_VERSION_1_18) { + if (loader::context->driverDDIPathDefault) { + pDdiTable->pfnSetHealthStatusExt = loader_driver_ddi::zesDeviceSetHealthStatusExt; + } else { + pDdiTable->pfnSetHealthStatusExt = loader::zesDeviceSetHealthStatusExt; + } + } if (version >= ZE_API_VERSION_1_4) { if (loader::context->driverDDIPathDefault) { pDdiTable->pfnEccAvailable = loader_driver_ddi::zesDeviceEccAvailable; @@ -6335,6 +6403,12 @@ zesGetDeviceProcAddrTable( if (version >= ZE_API_VERSION_1_15) { pDdiTable->pfnPciLinkSpeedUpdateExt = firstDriver->dditable.zes.Device.pfnPciLinkSpeedUpdateExt; } + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnGetHealthStatusExt = firstDriver->dditable.zes.Device.pfnGetHealthStatusExt; + } + if (version >= ZE_API_VERSION_1_18) { + pDdiTable->pfnSetHealthStatusExt = firstDriver->dditable.zes.Device.pfnSetHealthStatusExt; + } if (version >= ZE_API_VERSION_1_4) { pDdiTable->pfnEccAvailable = firstDriver->dditable.zes.Device.pfnEccAvailable; } diff --git a/source/loader/zes_ldrddi.h b/source/loader/zes_ldrddi.h index 1f985ca4..fb1ea584 100644 --- a/source/loader/zes_ldrddi.h +++ b/source/loader/zes_ldrddi.h @@ -862,8 +862,10 @@ namespace loader_driver_ddi __zedlllocal ze_result_t ZE_APICALL zesPowerGetUsage( zes_pwr_handle_t hPower, ///< [in] Handle of the power domain. - uint32_t* pInstantPower, ///< [out] Returns the instant power usage in milliwatts. - uint32_t* pAveragePower ///< [out] Returns the average power usage in milliwatts. + uint32_t* pInstantPower, ///< [out][optional] Returns the instant power usage in milliwatts. If this + ///< is `nullptr`, the instant power usage will not be returned. + uint32_t* pAveragePower ///< [out][optional] Returns the average power usage in milliwatts. If this + ///< is `nullptr`, the average power usage will not be returned. ); __zedlllocal ze_result_t ZE_APICALL zesDeviceEnumPsus( @@ -1319,6 +1321,16 @@ namespace loader_driver_ddi ///< or set to default speed(false) zes_device_action_t* pendingAction ///< [out] Pending action ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGetHealthStatusExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_health_status_ext_t* pHealth ///< [out] Current health status of the device. + ); + __zedlllocal ze_result_t ZE_APICALL + zesDeviceSetHealthStatusExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_health_status_ext_t health ///< [in] New health status to be set for the device. + ); } #if defined(__cplusplus) diff --git a/source/loader/zes_ldrddi_driver_ddi.cpp b/source/loader/zes_ldrddi_driver_ddi.cpp index ba80c877..a3d81fc0 100644 --- a/source/loader/zes_ldrddi_driver_ddi.cpp +++ b/source/loader/zes_ldrddi_driver_ddi.cpp @@ -3420,8 +3420,10 @@ namespace loader_driver_ddi __zedlllocal ze_result_t ZE_APICALL zesPowerGetUsage( zes_pwr_handle_t hPower, ///< [in] Handle of the power domain. - uint32_t* pInstantPower, ///< [out] Returns the instant power usage in milliwatts. - uint32_t* pAveragePower ///< [out] Returns the average power usage in milliwatts. + uint32_t* pInstantPower, ///< [out][optional] Returns the instant power usage in milliwatts. If this + ///< is `nullptr`, the instant power usage will not be returned. + uint32_t* pAveragePower ///< [out][optional] Returns the average power usage in milliwatts. If this + ///< is `nullptr`, the average power usage will not be returned. ) { ze_result_t result = ZE_RESULT_SUCCESS; @@ -5279,6 +5281,68 @@ namespace loader_driver_ddi return result; } + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceGetHealthStatusExt + __zedlllocal ze_result_t ZE_APICALL + zesDeviceGetHealthStatusExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_health_status_ext_t* pHealth ///< [out] Current health status of the device. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDevice )->pSysman; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->Device == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + auto pfnGetHealthStatusExt = dditable->Device->pfnGetHealthStatusExt; + if( nullptr == pfnGetHealthStatusExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnGetHealthStatusExt( hDevice, pHealth ); + return result; + } + + /////////////////////////////////////////////////////////////////////////////// + /// @brief Intercept function for zesDeviceSetHealthStatusExt + __zedlllocal ze_result_t ZE_APICALL + zesDeviceSetHealthStatusExt( + zes_device_handle_t hDevice, ///< [in] Sysman handle of the device. + zes_device_health_status_ext_t health ///< [in] New health status to be set for the device. + ) + { + ze_result_t result = ZE_RESULT_SUCCESS; + + // extract handle's function pointer table + auto dditable = reinterpret_cast( hDevice )->pSysman; + if (dditable->isValidFlag == 0) + return ZE_RESULT_ERROR_UNINITIALIZED; + // Check that api version in the driver is supported by this version of the API + if (dditable->version < ZE_API_VERSION_1_18) { + return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; + } + // Check that the driver has the function pointer table init + if (dditable->Device == nullptr) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + auto pfnSetHealthStatusExt = dditable->Device->pfnSetHealthStatusExt; + if( nullptr == pfnSetHealthStatusExt ) { + return ZE_RESULT_ERROR_UNINITIALIZED; + } + // forward to device-driver + result = pfnSetHealthStatusExt( hDevice, health ); + return result; + } + /////////////////////////////////////////////////////////////////////////////// /// @brief function for removing the ddi driver tables for zes diff --git a/source/utils/ze_to_string.h b/source/utils/ze_to_string.h index 766db61b..717e6977 100644 --- a/source/utils/ze_to_string.h +++ b/source/utils/ze_to_string.h @@ -1447,20 +1447,6 @@ inline std::string to_string(const ze_scheduling_hint_exp_desc_t& desc) { return to_string(&desc); } -inline std::string to_string(const ze_context_power_saving_hint_exp_desc_t* desc) { - if (!desc) return "nullptr"; - std::ostringstream oss; - oss << "{"; - oss << "stype=" << to_string(&desc->stype); - oss << ", hint=" << to_string(desc->hint); - oss << "}"; - return oss.str(); -} - -inline std::string to_string(const ze_context_power_saving_hint_exp_desc_t& desc) { - return to_string(&desc); -} - inline std::string to_string(const ze_eu_count_ext_t* desc) { if (!desc) return "nullptr"; std::ostringstream oss; @@ -2985,6 +2971,101 @@ inline std::string to_string(const ze_device_readonly_memory_ext_properties_t& d return to_string(&desc); } +inline std::string to_string(const ze_compiler_name_version_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "version=" << to_string(desc->version); + oss << ", name=" << to_string(desc->name); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const ze_compiler_name_version_t& desc) { + return to_string(&desc); +} + +inline std::string to_string(const ze_init_driver_app_version_ext_desc_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "stype=" << to_string(&desc->stype); + oss << ", apiVersionHint=" << to_string(&desc->apiVersionHint); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const ze_init_driver_app_version_ext_desc_t& desc) { + return to_string(&desc); +} + +inline std::string to_string(const ze_ipc_phys_mem_handle_range_ext_desc_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "stype=" << to_string(&desc->stype); + oss << ", size=" << to_string(desc->size); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const ze_ipc_phys_mem_handle_range_ext_desc_t& desc) { + return to_string(&desc); +} + +inline std::string to_string(const ze_device_npu_properties_ext_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "stype=" << to_string(&desc->stype); + oss << ", tileCount=" << to_string(desc->tileCount); + oss << ", tileEnableMask=" << to_string(desc->tileEnableMask); + oss << ", totalShaveCount=" << to_string(desc->totalShaveCount); + oss << ", int8x8MacsPerTile=" << to_string(desc->int8x8MacsPerTile); + oss << ", totalDpuMacs=" << to_string(desc->totalDpuMacs); + oss << ", numComputeEngines=" << to_string(desc->numComputeEngines); + oss << ", numCopyEngines=" << to_string(desc->numCopyEngines); + oss << ", dpuClockRateHz=" << to_string(desc->dpuClockRateHz); + oss << ", timestampFreqHz=" << to_string(desc->timestampFreqHz); + oss << ", nnSramSizeBytes=" << to_string(desc->nnSramSizeBytes); + oss << ", compilerVersion=" << to_string(desc->compilerVersion); + oss << ", maxOVOpsetVersionSupported=" << to_string(desc->maxOVOpsetVersionSupported); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const ze_device_npu_properties_ext_t& desc) { + return to_string(&desc); +} + +inline std::string to_string(const ze_context_power_saving_hint_ext_desc_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "stype=" << to_string(&desc->stype); + oss << ", hint=" << to_string(desc->hint); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const ze_context_power_saving_hint_ext_desc_t& desc) { + return to_string(&desc); +} + +inline std::string to_string(const ze_context_power_saving_hint_exp_desc_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "stype=" << to_string(&desc->stype); + oss << ", hint=" << to_string(desc->hint); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const ze_context_power_saving_hint_exp_desc_t& desc) { + return to_string(&desc); +} + } // namespace loader #endif // _ZE_TO_STRING_H diff --git a/source/utils/zes_to_string.h b/source/utils/zes_to_string.h index a2d015b9..219b48fb 100644 --- a/source/utils/zes_to_string.h +++ b/source/utils/zes_to_string.h @@ -1529,6 +1529,22 @@ inline std::string to_string(const zes_oem_serial_id_ext_properties_t& desc) { return to_string(&desc); } +inline std::string to_string(const zes_memory_vendor_info_ext_properties_t* desc) { + if (!desc) return "nullptr"; + std::ostringstream oss; + oss << "{"; + oss << "stype=" << to_string(&desc->stype); + oss << ", vendorId=" << to_string(desc->vendorId); + oss << ", length=" << to_string(desc->length); + oss << ", vendorName=" << to_string(desc->vendorName); + oss << "}"; + return oss.str(); +} + +inline std::string to_string(const zes_memory_vendor_info_ext_properties_t& desc) { + return to_string(&desc); +} + } // namespace loader #endif // _ZES_TO_STRING_H